From e0dee06252cbcbc0de7169ccb7bc2351e0675189 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Tue, 1 Dec 2020 07:56:56 -0800 Subject: [PATCH] Live: publish all dashboard changes to a single channel (#29474) --- pkg/services/live/features/dashboard.go | 6 +++++- public/app/features/live/dashboard/dashboardWatcher.ts | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/services/live/features/dashboard.go b/pkg/services/live/features/dashboard.go index 4f8cba42921..45db283aa35 100644 --- a/pkg/services/live/features/dashboard.go +++ b/pkg/services/live/features/dashboard.go @@ -48,7 +48,11 @@ func (h *DashboardHandler) publish(event dashboardEvent) error { if err != nil { return err } - return h.Publisher("grafana/dashboard/"+event.UID, msg) + err = h.Publisher("grafana/dashboard/uid/"+event.UID, msg) + if err != nil { + return err + } + return h.Publisher("grafana/dashboard/changes", msg) } // DashboardSaved will broadcast to all connected dashboards diff --git a/public/app/features/live/dashboard/dashboardWatcher.ts b/public/app/features/live/dashboard/dashboardWatcher.ts index 0dcac078f1d..8e3f71a7528 100644 --- a/public/app/features/live/dashboard/dashboardWatcher.ts +++ b/public/app/features/live/dashboard/dashboardWatcher.ts @@ -61,13 +61,11 @@ class DashboardWatcher { this.channel = live.getChannel({ scope: LiveChannelScope.Grafana, namespace: 'dashboard', - path: uid, + path: `uid/${uid}`, }); this.channel.getStream().subscribe(this.observer); this.uid = uid; } - - console.log('Watch', uid); } leave() {