diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index 2418eb9..1841224 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -558,7 +558,18 @@ def pie_panel(panel_id, title, expr, grid): } -def bargauge_panel(panel_id, title, expr, grid, *, unit="none", links=None, limit=None): +def bargauge_panel( + panel_id, + title, + expr, + grid, + *, + unit="none", + links=None, + limit=None, + thresholds=None, + decimals=None, +): """Return a bar gauge panel with label-aware reduction.""" panel = { "id": panel_id, @@ -572,7 +583,8 @@ def bargauge_panel(panel_id, title, expr, grid, *, unit="none", links=None, limi "unit": unit, "min": 0, "max": 100 if unit == "percent" else None, - "thresholds": { + "thresholds": thresholds + or { "mode": "absolute", "steps": [ {"color": "green", "value": None}, @@ -594,6 +606,8 @@ def bargauge_panel(panel_id, title, expr, grid, *, unit="none", links=None, limi }, }, } + if decimals is not None: + panel["fieldConfig"]["defaults"]["decimals"] = decimals if links: panel["links"] = links # Keep bars ordered by value descending for readability. @@ -893,6 +907,16 @@ def build_overview(): {"h": 10, "w": 12, "x": 12, "y": 54}, unit="none", limit=12, + decimals=0, + thresholds={ + "mode": "absolute", + "steps": [ + {"color": "green", "value": None}, + {"color": "yellow", "value": 50}, + {"color": "orange", "value": 75}, + {"color": "red", "value": 100}, + ], + }, ) ) @@ -1091,6 +1115,16 @@ def build_pods_dashboard(): {"h": 8, "w": 12, "x": 0, "y": 34}, unit="none", limit=12, + decimals=0, + thresholds={ + "mode": "absolute", + "steps": [ + {"color": "green", "value": None}, + {"color": "yellow", "value": 50}, + {"color": "orange", "value": 75}, + {"color": "red", "value": 100}, + ], + }, ) ) return { diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index bf2a5b9..b4c37af 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -1469,14 +1469,15 @@ }, { "color": "orange", - "value": 70 + "value": 75 }, { "color": "red", - "value": 85 + "value": 100 } ] - } + }, + "decimals": 0 }, "overrides": [] }, diff --git a/services/monitoring/dashboards/atlas-pods.json b/services/monitoring/dashboards/atlas-pods.json index 09c40e0..0e497de 100644 --- a/services/monitoring/dashboards/atlas-pods.json +++ b/services/monitoring/dashboards/atlas-pods.json @@ -452,14 +452,15 @@ }, { "color": "orange", - "value": 70 + "value": 75 }, { "color": "red", - "value": 85 + "value": 100 } ] - } + }, + "decimals": 0 }, "overrides": [] }, diff --git a/services/monitoring/grafana-dashboard-overview.yaml b/services/monitoring/grafana-dashboard-overview.yaml index cbe2483..bec60ae 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -1478,14 +1478,15 @@ data: }, { "color": "orange", - "value": 70 + "value": 75 }, { "color": "red", - "value": 85 + "value": 100 } ] - } + }, + "decimals": 0 }, "overrides": [] }, diff --git a/services/monitoring/grafana-dashboard-pods.yaml b/services/monitoring/grafana-dashboard-pods.yaml index 48089ee..3eb80b2 100644 --- a/services/monitoring/grafana-dashboard-pods.yaml +++ b/services/monitoring/grafana-dashboard-pods.yaml @@ -461,14 +461,15 @@ data: }, { "color": "orange", - "value": 70 + "value": 75 }, { "color": "red", - "value": 85 + "value": 100 } ] - } + }, + "decimals": 0 }, "overrides": [] },