From: Aashish Sharma Date: Wed, 17 Sep 2025 06:58:16 +0000 (+0530) Subject: monitoring/ceph_mixin: fix Cluster - Advanced OSD grafana panel X-Git-Tag: testing/wip-jcollin-testing-20251004.055540-tentacle~29^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5766d500c012875d38d631d0adbbaaa65770c28f;p=ceph-ci.git monitoring/ceph_mixin: fix Cluster - Advanced OSD grafana panel 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 (cherry picked from commit 53a6856d603e0fe4ff31f76e19263a80359a9f1d) --- diff --git a/monitoring/ceph-mixin/dashboards/ceph-cluster.libsonnet b/monitoring/ceph-mixin/dashboards/ceph-cluster.libsonnet index 6b5baff3f56..442faac7fec 100644 --- a/monitoring/ceph-mixin/dashboards/ceph-cluster.libsonnet +++ b/monitoring/ceph-mixin/dashboards/ceph-cluster.libsonnet @@ -136,7 +136,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', @@ -233,7 +233,6 @@ local g = import 'grafonnet/grafana.libsonnet'; ) .addThresholds([ { color: 'green', value: null }, - { color: 'red', value: 80 }, ]) .addTargets([ $.addTargetSchema( @@ -259,7 +258,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', @@ -308,6 +307,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( @@ -453,7 +475,7 @@ local g = import 'grafonnet/grafana.libsonnet'; displayName='', maxDataPoints=100, colorMode='none', - unit='decbytes', + unit='bytes', pluginVersion='9.4.7', ) .addMappings([ @@ -713,7 +735,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', @@ -755,7 +777,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', diff --git a/monitoring/ceph-mixin/dashboards_out/ceph-cluster-advanced.json b/monitoring/ceph-mixin/dashboards_out/ceph-cluster-advanced.json index da2f676b202..fcb8c62fe08 100644 --- a/monitoring/ceph-mixin/dashboards_out/ceph-cluster-advanced.json +++ b/monitoring/ceph-mixin/dashboards_out/ceph-cluster-advanced.json @@ -290,7 +290,7 @@ } ] }, - "unit": "decbytes" + "unit": "bytes" } }, "gridPos": { @@ -505,15 +505,75 @@ { "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, @@ -571,7 +631,7 @@ "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, @@ -913,7 +973,7 @@ } ] }, - "unit": "decbytes" + "unit": "bytes" } }, "gridPos": { @@ -1483,7 +1543,7 @@ } ] }, - "unit": "decbytes" + "unit": "bytes" }, "overrides": [ ] }, @@ -1590,7 +1650,7 @@ } ] }, - "unit": "decbytes" + "unit": "bytes" }, "overrides": [ ] },