From f6e4f0120716e71901d3186af2d4495ad7359327 Mon Sep 17 00:00:00 2001 From: cloudbehl Date: Wed, 9 Aug 2023 23:35:08 +0530 Subject: [PATCH] mgr/dashboard: Add telemetry link in dashboard Fixes: https://tracker.ceph.com/issues/62380 Signed-off-by: cloudbehl --- .../dashboard/dashboard-v3.component.html | 17 +++++++++++++++++ .../dashboard/dashboard-v3.component.ts | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html index bb1080d21f643..972a861549fc5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html @@ -21,6 +21,23 @@ + +
Telemetry Dashboard + + {{ telemetryEnabled ? 'Active' : 'Inactive' }} + +
+
+ + {{ telemetryURL }} + + +
+
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.ts index 82b70d4b0d702..01bd621d35ae2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.ts @@ -23,6 +23,7 @@ import { SummaryService } from '~/app/shared/services/summary.service'; import { PrometheusListHelper } from '~/app/shared/helpers/prometheus-list-helper'; import { PrometheusAlertService } from '~/app/shared/services/prometheus-alert.service'; import { OrchestratorService } from '~/app/shared/api/orchestrator.service'; +import { MgrModuleService } from '~/app/shared/api/mgr-module.service'; @Component({ selector: 'cd-dashboard-v3', @@ -65,6 +66,8 @@ export class DashboardV3Component extends PrometheusListHelper implements OnInit WRITECLIENTTHROUGHPUT: '', RECOVERYBYTES: '' }; + telemetryEnabled: boolean; + telemetryURL = 'https://telemetry-public.ceph.com/'; timerGetPrometheusDataSub: Subscription; timerTime = 30000; readonly lastHourDateObject = { @@ -82,6 +85,7 @@ export class DashboardV3Component extends PrometheusListHelper implements OnInit private featureToggles: FeatureTogglesService, private healthService: HealthService, public prometheusService: PrometheusService, + private mgrModuleService: MgrModuleService, private refreshIntervalService: RefreshIntervalService, public prometheusAlertService: PrometheusAlertService ) { @@ -98,8 +102,16 @@ export class DashboardV3Component extends PrometheusListHelper implements OnInit }); this.getPrometheusData(this.lastHourDateObject); this.getDetailsCardData(); + this.getTelemetryReport(); } + getTelemetryText(): string { + return this.telemetryEnabled + ? 'Cluster telemetry is active' + : 'Cluster telemetry is inactive. To Activate the Telemetry, \ + click settings icon on top navigation bar and select \ + Telemetry configration.'; + } ngOnDestroy() { this.interval.unsubscribe(); if (this.timerGetPrometheusDataSub) { @@ -173,4 +185,10 @@ export class DashboardV3Component extends PrometheusListHelper implements OnInit this.queriesResults ); } + + private getTelemetryReport() { + this.mgrModuleService.getConfig('telemetry').subscribe((resp: any) => { + this.telemetryEnabled = resp?.enabled; + }); + } } -- 2.39.5