From b72a68301a84c9576998ea8e43a2a4b9a957e495 Mon Sep 17 00:00:00 2001 From: Aashish Sharma Date: Thu, 16 May 2024 13:56:34 +0530 Subject: [PATCH] mgr/dashboard: Fix host count per cluster and total hosts count on multi-cluster overview page Fixes: https://tracker.ceph.com/issues/66058 Signed-off-by: Aashish Sharma --- .../ceph/cluster/multi-cluster/multi-cluster.component.html | 1 + .../frontend/src/app/shared/enum/dashboard-promqls.enum.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.html index 0b209abaa505d..e64e2f46e2a4a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster.component.html @@ -113,6 +113,7 @@ i18n-title class="col-sm-6 m-0 p-0 ps-2 pe-2" aria-label="Alerts" + [fullHeight]="true" *ngIf="queriesResults['ALERTS_COUNT'] && queriesResults['ALERTS_COUNT'][0]">

diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts index 117cc943d51a1..1a7c7af9d3a46 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts @@ -34,8 +34,8 @@ export enum MultiClusterPromqls { CRITICAL_ALERTS_COUNT = 'count(ALERTS{alertstate="firing",severity="critical"}) or vector(0)', WARNING_ALERTS_COUNT = 'count(ALERTS{alertstate="firing",severity="warning"}) or vector(0)', ALERTS = 'ALERTS{alertstate="firing"}', - HOSTS = 'sum by (hostname, cluster) (group by (hostname, cluster) (ceph_osd_metadata)) or vector(0)', - TOTAL_HOSTS = 'count by (cluster) (ceph_osd_metadata) or vector(0)', + HOSTS = 'count_values("hostname", ceph_mon_metadata) by (cluster) or vector (0)', + TOTAL_HOSTS = 'count(sum by (hostname) (ceph_osd_metadata)) or vector(0)', CLUSTER_ALERTS = 'count by (cluster) (ALERTS{alertstate="firing"}) or vector(0)' } -- 2.39.5