From 87fbba0d3e19545bf0f286052fe1586f02ebdf27 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Fri, 12 Dec 2025 16:15:37 -0300 Subject: [PATCH] atlas overview: show availability percent with 3 decimals --- scripts/dashboards_render_atlas.py | 19 +++++++++++++------ .../monitoring/dashboards/atlas-overview.json | 5 +++-- .../grafana-dashboard-overview.yaml | 5 +++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index 76fe0bc..7ca8194 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -340,6 +340,7 @@ def stat_panel( grid, *, unit="none", + decimals=None, thresholds=None, text_mode="value", legend=None, @@ -364,6 +365,8 @@ def stat_panel( } if value_suffix: defaults["custom"]["valueSuffix"] = value_suffix + if decimals is not None: + defaults["decimals"] = decimals panel = { "id": panel_id, "type": "stat", @@ -639,6 +642,8 @@ def build_overview(): "kind": "stat", "thresholds": UPTIME_PERCENT_THRESHOLDS, "value_suffix": "%", + "unit": "percentunit", + "decimals": 3, "text_mode": "value", }, { @@ -693,12 +698,14 @@ def build_overview(): item["expr"], grid, thresholds=item.get("thresholds"), - legend=None, - links=item.get("links"), - text_mode=item.get("text_mode", "value"), - value_suffix=item.get("value_suffix"), - ) - ) + legend=None, + links=item.get("links"), + text_mode=item.get("text_mode", "value"), + value_suffix=item.get("value_suffix"), + unit=item.get("unit", "none"), + decimals=item.get("decimals"), + ) + ) else: panels.append( gauge_panel( diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index 04e5929..3dec2aa 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -257,11 +257,12 @@ } ] }, - "unit": "none", + "unit": "percentunit", "custom": { "displayMode": "auto", "valueSuffix": "%" - } + }, + "decimals": 3 }, "overrides": [] }, diff --git a/services/monitoring/grafana-dashboard-overview.yaml b/services/monitoring/grafana-dashboard-overview.yaml index d68631d..507a127 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -266,11 +266,12 @@ data: } ] }, - "unit": "none", + "unit": "percentunit", "custom": { "displayMode": "auto", "valueSuffix": "%" - } + }, + "decimals": 3 }, "overrides": [] },