Fix metrics calculations for engine uptime 11/132911/1
authoradheli.tavares <adheli.tavares@est.tech>
Fri, 13 Jan 2023 09:14:23 +0000 (09:14 +0000)
committeradheli.tavares <adheli.tavares@est.tech>
Fri, 13 Jan 2023 09:21:10 +0000 (09:21 +0000)
and remove unused variables.

Issue-ID: POLICY-4147
Change-Id: I09996770cdb3571c48f51bc0ee1b04094a3112b1
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
csit/metrics/dashboards/sla-metrics.json

index 6093b51..e94d91d 100644 (file)
   "fiscalYearStartMonth": 0,
   "gnetId": 14430,
   "graphTooltip": 0,
-  "id": 5,
-  "iteration": 1673087127172,
+  "id": 3,
+  "iteration": 1673599566103,
   "links": [],
   "liveNow": false,
   "panels": [
-    {
-      "fieldConfig": {
-        "defaults": {
-          "color": {
-            "mode": "palette-classic"
-          },
-          "custom": {
-            "axisLabel": "",
-            "axisPlacement": "auto",
-            "barAlignment": 0,
-            "drawStyle": "line",
-            "fillOpacity": 0,
-            "gradientMode": "none",
-            "hideFrom": {
-              "legend": false,
-              "tooltip": false,
-              "viz": false
-            },
-            "lineInterpolation": "linear",
-            "lineWidth": 1,
-            "pointSize": 5,
-            "scaleDistribution": {
-              "type": "linear"
-            },
-            "showPoints": "auto",
-            "spanNulls": false,
-            "stacking": {
-              "group": "A",
-              "mode": "none"
-            },
-            "thresholdsStyle": {
-              "mode": "off"
-            }
-          },
-          "mappings": [],
-          "thresholds": {
-            "mode": "absolute",
-            "steps": [
-              {
-                "color": "green",
-                "value": null
-              },
-              {
-                "color": "red",
-                "value": 80
-              }
-            ]
-          }
-        },
-        "overrides": []
-      },
-      "gridPos": {
-        "h": 8,
-        "w": 12,
-        "x": 0,
-        "y": 0
-      },
-      "id": 135,
-      "options": {
-        "legend": {
-          "calcs": [],
-          "displayMode": "list",
-          "placement": "bottom"
-        },
-        "tooltip": {
-          "mode": "single"
-        }
-      },
-      "targets": [
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "dkSf71fnz"
-          },
-          "exemplar": true,
-          "expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))",
-          "interval": "",
-          "legendFormat": "",
-          "refId": "A"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "dkSf71fnz"
-          },
-          "exemplar": true,
-          "expr": "",
-          "hide": false,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "B"
-        }
-      ],
-      "title": "Panel Title",
-      "type": "timeseries"
-    },
     {
       "collapsed": false,
       "gridPos": {
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 8
+        "y": 0
       },
       "id": 54,
       "panels": [],
         "h": 6,
         "w": 6,
         "x": 0,
-        "y": 9
+        "y": 1
       },
       "id": 52,
       "links": [],
         "h": 6,
         "w": 6,
         "x": 6,
-        "y": 9
+        "y": 1
       },
       "id": 56,
       "links": [],
         "h": 6,
         "w": 6,
         "x": 0,
-        "y": 15
+        "y": 7
       },
       "id": 58,
       "links": [],
         "h": 6,
         "w": 6,
         "x": 6,
-        "y": 15
+        "y": 7
       },
       "id": 60,
       "links": [],
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 21
+        "y": 13
       },
       "id": 96,
       "links": [],
         "h": 7,
         "w": 12,
         "x": 0,
-        "y": 29
+        "y": 21
       },
       "id": 95,
       "links": [],
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 36
+        "y": 28
       },
       "id": 113,
       "options": {
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 44
+        "y": 36
       },
       "id": 18,
       "panels": [],
       },
       "gridPos": {
         "h": 10,
-        "w": 18,
+        "w": 23,
         "x": 0,
-        "y": 45
+        "y": 37
       },
       "id": 4,
       "links": [],
       },
       "gridPos": {
         "h": 10,
-        "w": 18,
+        "w": 23,
         "x": 0,
-        "y": 55
+        "y": 47
       },
       "id": 2,
       "links": [],
           "calcs": [
             "mean",
             "max",
-            "min"
+            "min",
+            "lastNotNull"
           ],
           "displayMode": "table",
           "placement": "right"
         "overrides": []
       },
       "gridPos": {
-        "h": 8,
-        "w": 13,
+        "h": 10,
+        "w": 22,
         "x": 0,
-        "y": 65
+        "y": 57
       },
       "id": 111,
       "links": [],
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 73
+        "y": 67
       },
       "id": 115,
       "panels": [],
         "h": 6,
         "w": 3,
         "x": 0,
-        "y": 74
+        "y": 68
       },
       "id": 117,
       "options": {
         "h": 6,
         "w": 3,
         "x": 3,
-        "y": 74
+        "y": 68
       },
       "id": 118,
       "options": {
         "h": 6,
         "w": 3,
         "x": 6,
-        "y": 74
+        "y": 68
       },
       "id": 119,
       "options": {
         "h": 6,
         "w": 3,
         "x": 9,
-        "y": 74
+        "y": 68
       },
       "id": 120,
       "options": {
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 80
+        "y": 74
       },
       "id": 128,
       "options": {
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 88
+        "y": 82
       },
       "id": 122,
       "options": {
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 96
+        "y": 90
       },
       "id": 124,
       "panels": [],
         "h": 8,
         "w": 5,
         "x": 0,
-        "y": 97
+        "y": 91
       },
       "id": 126,
       "options": {
       "type": "stat"
     },
     {
-      "description": "Uptime per engine for Policy APEX-PDP application calculated in days",
+      "description": "",
       "fieldConfig": {
         "defaults": {
           "color": {
               }
             ]
           },
-          "unit": "none"
+          "unit": "ms"
         },
         "overrides": []
       },
       "gridPos": {
         "h": 8,
-        "w": 5,
+        "w": 8,
         "x": 5,
-        "y": 97
+        "y": 91
       },
       "id": 130,
       "options": {
             "type": "prometheus",
             "uid": "dkSf71fnz"
           },
-          "exemplar": true,
-          "expr": "avg by(engine_instance_id)((time() - pdpa_engine_last_start_timestamp_epoch{job=\"apex-pdp-metrics\"}/1000)/86400)",
+          "exemplar": false,
+          "expr": "(time() * 1000) - (pdpa_engine_last_start_timestamp_epoch{job=\"apex-pdp-metrics\"})",
           "format": "time_series",
-          "instant": false,
+          "instant": true,
           "interval": "",
           "legendFormat": "{{ engine_instance_id }}",
           "refId": "A"
         }
       ],
-      "title": "Engine Uptime (days)",
+      "title": "Engine Uptime (since last start)",
       "transformations": [],
       "type": "stat"
     },
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 105
+        "y": 99
       },
       "id": 132,
       "options": {
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 113
+        "y": 107
       },
       "id": 133,
       "options": {
   "style": "dark",
   "tags": [],
   "templating": {
-    "list": [
-      {
-        "current": {
-          "selected": false,
-          "text": "policy-api:6969",
-          "value": "policy-api:6969"
-        },
-        "datasource": {
-          "type": "prometheus",
-          "uid": "dkSf71fnz"
-        },
-        "definition": "label_values(jvm_classes_loaded_classes, instance)",
-        "hide": 0,
-        "includeAll": false,
-        "label": "Instance",
-        "multi": false,
-        "name": "instance",
-        "options": [],
-        "query": {
-          "query": "label_values(jvm_classes_loaded_classes, instance)",
-          "refId": "Prometheus-instance-Variable-Query"
-        },
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "sort": 1,
-        "tagValuesQuery": "",
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
-      }
-    ]
+    "list": []
   },
   "time": {
     "from": "now-5m",
   "timezone": "",
   "title": "SLA's Metrics",
   "uid": "ySoel0jnk",
-  "version": 4,
+  "version": 6,
   "weekStart": ""
 }
\ No newline at end of file