]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
monitoring/ceph_mixin: fix Cluster - Advanced OSD grafana panel
authorAashish Sharma <Aashish.Sharma1@ibm.com>
Wed, 17 Sep 2025 06:58:16 +0000 (12:28 +0530)
committerAashish Sharma <Aashish.Sharma1@ibm.com>
Thu, 25 Sep 2025 05:07:19 +0000 (10:37 +0530)
1. Fixes the promql expr used to calculate "In" OSDs in
   ceph-cluster-advanced.json.
2. Fixes the color coding for the single state panels used in the OSDs
   grafana panel like "In", "Out" etc

Fixes: https://tracker.ceph.com/issues/72810
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit 53a6856d603e0fe4ff31f76e19263a80359a9f1d)

monitoring/ceph-mixin/dashboards/ceph-cluster.libsonnet
monitoring/ceph-mixin/dashboards_out/ceph-cluster-advanced.json

index a6991f54cdedd701c0efab903ae378b25016245c..05b74db02cf4a4aefe72358265ad43f2b0556d21 100644 (file)
@@ -123,7 +123,7 @@ local g = import 'grafonnet/grafana.libsonnet';
 
       $.addStatPanel(
         title='Cluster Capacity',
-        unit='decbytes',
+        unit='bytes',
         datasource='$datasource',
         gridPosition={ x: 6, y: 1, w: 3, h: 3 },
         graphMode='area',
@@ -220,7 +220,6 @@ local g = import 'grafonnet/grafana.libsonnet';
       )
       .addThresholds([
         { color: 'green', value: null },
-        { color: 'red', value: 80 },
       ])
       .addTargets([
         $.addTargetSchema(
@@ -246,7 +245,7 @@ local g = import 'grafonnet/grafana.libsonnet';
           displayValueWithAlias='When Alias Displayed',
           units='none',
           valueHandler='Number Threshold',
-          expr='count(ceph_osd_in{%(matchers)s})' % $.matchers(),
+          expr='sum(ceph_osd_in{%(matchers)s})' % $.matchers(),
           legendFormat='In',
           interval='$interval',
           datasource='$datasource',
@@ -295,6 +294,29 @@ local g = import 'grafonnet/grafana.libsonnet';
           warn=1,
           datasource='$datasource',
         ),
+      ])
+      .addOverrides([
+        { matcher: { id: 'byName', options: 'All' }, properties: [
+          { id: 'color', value: { mode: 'fixed' } },
+        ] },
+        { matcher: { id: 'byName', options: 'Out' }, properties: [
+          {
+            id: 'thresholds',
+            value: { mode: 'absolute', steps: [
+              { color: 'green', value: null },
+              { color: 'red', value: 1 },
+            ] },
+          },
+        ] },
+        { matcher: { id: 'byName', options: 'Down' }, properties: [
+          {
+            id: 'thresholds',
+            value: { mode: 'absolute', steps: [
+              { color: 'green', value: null },
+              { color: 'red', value: 1 },
+            ] },
+          },
+        ] },
       ]),
 
       $.addStatPanel(
@@ -440,7 +462,7 @@ local g = import 'grafonnet/grafana.libsonnet';
         displayName='',
         maxDataPoints=100,
         colorMode='none',
-        unit='decbytes',
+        unit='bytes',
         pluginVersion='9.4.7',
       )
       .addMappings([
@@ -700,7 +722,7 @@ local g = import 'grafonnet/grafana.libsonnet';
         pointSize=5,
         lineWidth=1,
         showPoints='never',
-        unit='decbytes',
+        unit='bytes',
         displayMode='table',
         tooltip={ mode: 'multi', sort: 'desc' },
         interval='$interval',
@@ -742,7 +764,7 @@ local g = import 'grafonnet/grafana.libsonnet';
         pointSize=5,
         lineWidth=1,
         showPoints='never',
-        unit='decbytes',
+        unit='bytes',
         displayMode='table',
         tooltip={ mode: 'multi', sort: 'desc' },
         interval='$interval',
index ff31ebf23bac49737eacbb7ae328be0e398acc62..c295b2472b8f7d57d929b8640070d4b25b533fdb 100644 (file)
                      }
                   ]
                },
-               "unit": "decbytes"
+               "unit": "bytes"
             }
          },
          "gridPos": {
                      {
                         "color": "green",
                         "value": null
-                     },
-                     {
-                        "color": "red",
-                        "value": 80
                      }
                   ]
                },
                "unit": "none"
-            }
+            },
+            "overrides": [
+               {
+                  "matcher": {
+                     "id": "byName",
+                     "options": "All"
+                  },
+                  "properties": [
+                     {
+                        "id": "color",
+                        "value": {
+                           "mode": "fixed"
+                        }
+                     }
+                  ]
+               },
+               {
+                  "matcher": {
+                     "id": "byName",
+                     "options": "Out"
+                  },
+                  "properties": [
+                     {
+                        "id": "thresholds",
+                        "value": {
+                           "mode": "absolute",
+                           "steps": [
+                              {
+                                 "color": "green",
+                                 "value": null
+                              },
+                              {
+                                 "color": "red",
+                                 "value": 1
+                              }
+                           ]
+                        }
+                     }
+                  ]
+               },
+               {
+                  "matcher": {
+                     "id": "byName",
+                     "options": "Down"
+                  },
+                  "properties": [
+                     {
+                        "id": "thresholds",
+                        "value": {
+                           "mode": "absolute",
+                           "steps": [
+                              {
+                                 "color": "green",
+                                 "value": null
+                              },
+                              {
+                                 "color": "red",
+                                 "value": 1
+                              }
+                           ]
+                        }
+                     }
+                  ]
+               }
+            ]
          },
          "flipCard": false,
          "flipTime": 5,
                "displayAliasType": "Always",
                "displayType": "Regular",
                "displayValueWithAlias": "When Alias Displayed",
-               "expr": "count(ceph_osd_in{cluster=~\"$cluster\", })",
+               "expr": "sum(ceph_osd_in{cluster=~\"$cluster\", })",
                "format": "time_series",
                "interval": "$interval",
                "intervalFactor": 1,
                      }
                   ]
                },
-               "unit": "decbytes"
+               "unit": "bytes"
             }
          },
          "gridPos": {
                      }
                   ]
                },
-               "unit": "decbytes"
+               "unit": "bytes"
             },
             "overrides": [ ]
          },
                      }
                   ]
                },
-               "unit": "decbytes"
+               "unit": "bytes"
             },
             "overrides": [ ]
          },