Fixed Negative Heap Memory on Grafana Chart 05/130505/3
authorbrunomilitzer <bruno.militzer@est.tech>
Tue, 30 Aug 2022 08:47:02 +0000 (09:47 +0100)
committerLiam Fallon <liam.fallon@est.tech>
Thu, 8 Sep 2022 12:59:29 +0000 (12:59 +0000)
- fixed unit to seconds (so it caulculates time)
- fixed formula with time-up variable

Issue-ID: POLICY-4326
Change-Id: I324b01d9abc92938027daafa1ebe73dccea5baba
Signed-off-by: brunomilitzer <bruno.militzer@est.tech>
csit/metrics/dashboards/dashboard-distribution.json

index 39b9675..1a53fcb 100644 (file)
@@ -22,7 +22,7 @@
   "editable": true,
   "fiscalYearStartMonth": 0,
   "graphTooltip": 0,
-  "id": 8,
+  "id": 5,
   "links": [],
   "liveNow": false,
   "panels": [
         "x": 0,
         "y": 0
       },
-      "id": 2,
+      "id": 19,
       "panels": [],
       "title": "Quick Info",
       "type": "row"
     },
     {
-      "description": "Uptime per pod for Policy Distribution application calculated in days",
+      "description": "Uptime for Policy Distribution application",
       "fieldConfig": {
         "defaults": {
           "color": {
-            "mode": "thresholds"
+            "mode": "palette-classic"
           },
+          "decimals": 1,
           "mappings": [],
           "thresholds": {
             "mode": "absolute",
                 "value": 80
               }
             ]
-          }
+          },
+          "unit": "s"
         },
         "overrides": []
       },
       "gridPos": {
-        "h": 6,
-        "w": 6,
+        "h": 9,
+        "w": 8,
         "x": 0,
         "y": 1
       },
       "id": 4,
       "options": {
         "colorMode": "value",
-        "graphMode": "area",
+        "graphMode": "none",
         "justifyMode": "auto",
         "orientation": "auto",
         "reduceOptions": {
-          "calcs": [],
+          "calcs": [
+            "lastNotNull"
+          ],
           "fields": "",
           "values": false
         },
+        "text": {},
         "textMode": "auto"
       },
       "pluginVersion": "8.3.4",
             "type": "prometheus",
             "uid": "dkSf71fnz"
           },
-          "exemplar": true,
-          "expr": "process_start_time_seconds{job=\"distribution-metrics\"} / 86400",
+          "exemplar": false,
+          "expr": "time()-process_start_time_seconds{job=\"distribution-metrics\"}",
+          "format": "time_series",
+          "instant": false,
           "interval": "",
           "legendFormat": "",
           "refId": "A"
         }
       ],
-      "title": "Process Uptime (days)",
+      "title": "Process Uptime",
+      "transformations": [],
       "transparent": true,
       "type": "stat"
     },
       "fieldConfig": {
         "defaults": {
           "color": {
-            "mode": "thresholds"
+            "mode": "palette-classic"
           },
+          "decimals": 2,
           "mappings": [],
+          "max": 100,
+          "min": 0,
           "thresholds": {
             "mode": "absolute",
             "steps": [
               {
                 "color": "green",
                 "value": null
-              },
-              {
-                "color": "red",
-                "value": 80
               }
             ]
-          }
+          },
+          "unit": "percent"
         },
         "overrides": []
       },
       "gridPos": {
-        "h": 6,
-        "w": 8,
-        "x": 6,
+        "h": 8,
+        "w": 7,
+        "x": 9,
         "y": 1
       },
-      "id": 6,
+      "id": 26,
       "options": {
         "orientation": "auto",
         "reduceOptions": {
           "calcs": [
-            "lastNotNull"
+            "last"
           ],
           "fields": "",
           "values": false
         },
         "showThresholdLabels": false,
-        "showThresholdMarkers": true
+        "showThresholdMarkers": false
       },
       "pluginVersion": "8.3.4",
       "targets": [
           "exemplar": true,
           "expr": "process_cpu_seconds_total{job=\"distribution-metrics\"}",
           "interval": "",
-          "legendFormat": "process_cpu: {{pod}}",
+          "legendFormat": "",
           "refId": "A"
         }
       ],
       "fieldConfig": {
         "defaults": {
           "color": {
-            "mode": "thresholds"
+            "mode": "palette-classic"
           },
           "mappings": [],
+          "max": 100,
+          "min": 0,
           "thresholds": {
             "mode": "absolute",
             "steps": [
                 "value": 80
               }
             ]
-          }
+          },
+          "unit": "percent"
         },
         "overrides": []
       },
       "gridPos": {
-        "h": 6,
-        "w": 8,
-        "x": 15,
+        "h": 8,
+        "w": 6,
+        "x": 17,
         "y": 1
       },
-      "id": 8,
+      "id": 27,
       "options": {
         "orientation": "auto",
         "reduceOptions": {
           "calcs": [
-            "lastNotNull"
+            "last"
           ],
           "fields": "",
           "values": false
         },
         "showThresholdLabels": false,
-        "showThresholdMarkers": true
+        "showThresholdMarkers": false
       },
       "pluginVersion": "8.3.4",
       "targets": [
             "uid": "dkSf71fnz"
           },
           "exemplar": true,
-          "expr": "100 * sum by(pod)(jvm_memory_bytes_used{area=\"heap\", job=\"distribution-metrics\"}) / sum by(pod)(jvm_memory_bytes_max{area=\"heap\", job=\"distribution-metrics\"})",
+          "expr": "100 * sum by(job)(jvm_memory_bytes_used{area=\"heap\", job=\"distribution-metrics\"}) / sum by(job)(jvm_memory_bytes_max{area=\"heap\", job=\"distribution-metrics\"})",
           "hide": false,
           "interval": "",
           "legendFormat": "Heap : {{pod}}",
           "refId": "A"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "dkSf71fnz"
-          },
-          "exemplar": true,
-          "expr": "100 * sum by(pod)(jvm_memory_bytes_used{area=\"nonheap\", job=\"distribution-metrics\"}) / sum by(pod)(jvm_memory_bytes_max{area=\"nonheap\", job=\"distribution-metrics\"})",
-          "hide": false,
-          "interval": "",
-          "legendFormat": "Non Heap : {{pod}}",
-          "refId": "B"
         }
       ],
       "title": "Memory Usage",
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 7
+        "y": 10
       },
-      "id": 10,
+      "id": 17,
       "panels": [],
       "title": "System",
       "type": "row"
               "viz": false
             },
             "lineInterpolation": "linear",
+            "lineStyle": {
+              "fill": "solid"
+            },
             "lineWidth": 1,
-            "pointSize": 5,
+            "pointSize": 1,
             "scaleDistribution": {
               "type": "linear"
             },
                 "value": 80
               }
             ]
-          }
+          },
+          "unit": "percent"
         },
         "overrides": []
       },
         "h": 14,
         "w": 12,
         "x": 0,
-        "y": 8
+        "y": 11
       },
-      "id": 12,
+      "id": 2,
       "options": {
         "legend": {
-          "calcs": [],
-          "displayMode": "list",
-          "placement": "bottom"
+          "calcs": [
+            "max",
+            "mean",
+            "last"
+          ],
+          "displayMode": "table",
+          "placement": "bottom",
+          "sortBy": "Max",
+          "sortDesc": true
         },
         "tooltip": {
-          "mode": "single"
+          "mode": "single",
+          "sort": "none"
         }
       },
       "targets": [
             "uid": "dkSf71fnz"
           },
           "exemplar": true,
-          "expr": "process_cpu_seconds_total{job=\"distribution-metrics\"} * 100",
+          "expr": "avg_over_time(process_cpu_seconds_total{job=\"distribution-metrics\"}[1m]) * 100",
           "interval": "",
           "legendFormat": "system: {{pod}}",
           "refId": "A"
             "uid": "dkSf71fnz"
           },
           "exemplar": true,
-          "expr": "process_cpu_seconds_total{job=\"distribution-metrics\"} * 100",
+          "expr": "avg_over_time(process_cpu_seconds_total{job=\"distribution-metrics\"}[5m]) * 100",
           "hide": false,
           "interval": "",
           "legendFormat": "process: {{pod}}",
           "refId": "B"
+        },
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "dkSf71fnz"
+          },
+          "exemplar": true,
+          "expr": "avg_over_time(process_cpu_seconds_total{job=\"distribution-metrics\"}[1h]) * 100",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "process_1h: {{pod}}",
+          "refId": "C"
         }
       ],
       "title": "CPU Usage",
               "viz": false
             },
             "lineInterpolation": "linear",
+            "lineStyle": {
+              "fill": "solid"
+            },
             "lineWidth": 1,
-            "pointSize": 5,
+            "pointSize": 1,
             "scaleDistribution": {
               "type": "linear"
             },
                 "value": 80
               }
             ]
-          }
+          },
+          "unit": "percent"
         },
         "overrides": []
       },
       "gridPos": {
-        "h": 8,
+        "h": 11,
         "w": 12,
         "x": 12,
-        "y": 8
+        "y": 11
       },
-      "id": 34,
+      "id": 13,
       "options": {
         "legend": {
-          "calcs": [],
-          "displayMode": "list",
-          "placement": "bottom"
+          "calcs": [
+            "max",
+            "mean",
+            "last"
+          ],
+          "displayMode": "table",
+          "placement": "bottom",
+          "sortBy": "Last",
+          "sortDesc": false
         },
         "tooltip": {
-          "mode": "single"
+          "mode": "single",
+          "sort": "none"
         }
       },
       "targets": [
           },
           "exemplar": true,
           "expr": "100 * sum(jvm_memory_bytes_used{area=\"heap\", job=\"distribution-metrics\"}) / sum(jvm_memory_bytes_max{area=\"heap\", job=\"distribution-metrics\"})",
+          "hide": false,
           "interval": "",
           "legendFormat": "Heap",
           "refId": "A"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "dkSf71fnz"
-          },
-          "exemplar": true,
-          "expr": "100 * sum(jvm_memory_bytes_used{area=\"nonheap\", job=\"distribution-metrics\"}) / sum(jvm_memory_bytes_max{area=\"nonheap\", job=\"distribution-metrics\"})",
-          "hide": false,
-          "interval": "",
-          "legendFormat": "Non Heap",
-          "refId": "B"
         }
       ],
       "title": "Memory Usage",
             "scaleDistribution": {
               "type": "linear"
             },
-            "showPoints": "auto",
-            "spanNulls": false,
+            "showPoints": "never",
+            "spanNulls": true,
             "stacking": {
               "group": "A",
               "mode": "none"
                 "value": 80
               }
             ]
-          }
+          },
+          "unit": "short"
         },
         "overrides": []
       },
         "h": 13,
         "w": 12,
         "x": 12,
-        "y": 16
+        "y": 22
       },
-      "id": 16,
+      "id": 8,
       "options": {
         "legend": {
-          "calcs": [],
-          "displayMode": "list",
+          "calcs": [
+            "max",
+            "last"
+          ],
+          "displayMode": "table",
           "placement": "bottom"
         },
         "tooltip": {
-          "mode": "single"
+          "mode": "multi",
+          "sort": "none"
         }
       },
+      "pluginVersion": "8.4.5",
       "targets": [
         {
           "datasource": {
           "interval": "",
           "legendFormat": "Peak Threads: {{ pod }}",
           "refId": "B"
+        },
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "dkSf71fnz"
+          },
+          "exemplar": true,
+          "expr": "jvm_threads_state{job=\"distribution-metrics\"}",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "State Threads: {{ pod }}",
+          "refId": "C"
         }
       ],
       "title": "JVM threads",
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 29
+        "y": 35
       },
-      "id": 18,
+      "id": 15,
       "panels": [],
       "title": "Garbage Collection",
       "type": "row"
             },
             "lineInterpolation": "linear",
             "lineWidth": 1,
-            "pointSize": 5,
+            "pointSize": 1,
             "scaleDistribution": {
               "type": "linear"
             },
                 "value": 80
               }
             ]
-          }
+          },
+          "unit": "ops"
         },
         "overrides": []
       },
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 30
+        "y": 36
       },
-      "id": 20,
+      "id": 10,
       "options": {
         "legend": {
-          "calcs": [],
-          "displayMode": "list",
+          "calcs": [
+            "max",
+            "mean",
+            "last"
+          ],
+          "displayMode": "table",
           "placement": "bottom"
         },
         "tooltip": {
-          "mode": "single"
+          "mode": "single",
+          "sort": "none"
         }
       },
       "targets": [
             },
             "lineInterpolation": "linear",
             "lineWidth": 1,
-            "pointSize": 5,
+            "pointSize": 1,
             "scaleDistribution": {
               "type": "linear"
             },
         "h": 8,
         "w": 12,
         "x": 12,
-        "y": 30
+        "y": 36
       },
       "id": 22,
       "options": {
         "legend": {
-          "calcs": [],
-          "displayMode": "list",
+          "calcs": [
+            "last"
+          ],
+          "displayMode": "table",
           "placement": "bottom"
         },
         "tooltip": {
-          "mode": "single"
+          "mode": "single",
+          "sort": "none"
         }
       },
       "targets": [
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 38
+        "y": 44
       },
-      "id": 24,
+      "id": 21,
       "panels": [],
       "title": "Statistics",
       "type": "row"
         "h": 11,
         "w": 12,
         "x": 0,
-        "y": 39
+        "y": 45
       },
       "id": 32,
       "options": {
     "list": []
   },
   "time": {
-    "from": "now-6h",
+    "from": "now-24h",
     "to": "now"
   },
   "timepicker": {},
   "timezone": "",
   "title": "Policy Distribution",
   "uid": "5HkCopg4z",
-  "version": 2,
+  "version": 5,
   "weekStart": ""
 }
\ No newline at end of file