From 2943914a0dc4abae52e18fb4776046d15ba98651 Mon Sep 17 00:00:00 2001 From: Aashish Sharma Date: Wed, 17 Sep 2025 12:28:16 +0530 Subject: [PATCH] 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) --- .../dashboards/ceph-cluster.libsonnet | 34 ++++++-- .../dashboards_out/ceph-cluster-advanced.json | 80 ++++++++++++++++--- 2 files changed, 98 insertions(+), 16 deletions(-) diff --git a/monitoring/ceph-mixin/dashboards/ceph-cluster.libsonnet b/monitoring/ceph-mixin/dashboards/ceph-cluster.libsonnet index a6991f54cde..05b74db02cf 100644 --- a/monitoring/ceph-mixin/dashboards/ceph-cluster.libsonnet +++ b/monitoring/ceph-mixin/dashboards/ceph-cluster.libsonnet @@ -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', diff --git a/monitoring/ceph-mixin/dashboards_out/ceph-cluster-advanced.json b/monitoring/ceph-mixin/dashboards_out/ceph-cluster-advanced.json index ff31ebf23ba..c295b2472b8 100644 --- a/monitoring/ceph-mixin/dashboards_out/ceph-cluster-advanced.json +++ b/monitoring/ceph-mixin/dashboards_out/ceph-cluster-advanced.json @@ -277,7 +277,7 @@ } ] }, - "unit": "decbytes" + "unit": "bytes" } }, "gridPos": { @@ -492,15 +492,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, @@ -558,7 +618,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, @@ -900,7 +960,7 @@ } ] }, - "unit": "decbytes" + "unit": "bytes" } }, "gridPos": { @@ -1470,7 +1530,7 @@ } ] }, - "unit": "decbytes" + "unit": "bytes" }, "overrides": [ ] }, @@ -1577,7 +1637,7 @@ } ] }, - "unit": "decbytes" + "unit": "bytes" }, "overrides": [ ] }, -- 2.39.5