From 4b5ce0efe75f78f32b25ff4bcde042efe79a8f2d Mon Sep 17 00:00:00 2001 From: Andrej Ocenas Date: Mon, 18 Nov 2024 18:17:28 +0100 Subject: [PATCH] Sidecar: Add rudderstack events (#96566) --- .../src/services/SidecarService_EXPERIMENTAL.ts | 10 +++++++++- public/app/plugins/panel/nodeGraph/panelcfg.cue | 6 +++--- public/app/plugins/panel/xychart/panelcfg.cue | 14 +++++++------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.ts b/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.ts index c91d2dc9181..98c4a1ff1a0 100644 --- a/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.ts +++ b/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.ts @@ -2,6 +2,7 @@ import * as H from 'history'; import { pick } from 'lodash'; import { BehaviorSubject, map, Observable } from 'rxjs'; +import { reportInteraction } from '../analytics/utils'; import { config } from '../config'; import { HistoryWrapper, LocationService, locationService } from './LocationService'; @@ -92,6 +93,8 @@ export class SidecarService_EXPERIMENTAL { } this._initialContext.next(context); this.memoryLocationService.push({ pathname: `/a/${pluginId}` }); + + reportInteraction('sidecar_service_open_app', { pluginId, version: 1 }); } /** @@ -104,6 +107,7 @@ export class SidecarService_EXPERIMENTAL { } this.memoryLocationService.push({ pathname: `/a/${pluginId}${path || ''}` }); + reportInteraction('sidecar_service_open_app', { pluginId, version: 2 }); } /** @@ -116,6 +120,8 @@ export class SidecarService_EXPERIMENTAL { this._initialContext.next(undefined); this.memoryLocationService.replace({ pathname: '/' }); + + reportInteraction('sidecar_service_close_app'); } /** @@ -139,7 +145,9 @@ export class SidecarService_EXPERIMENTAL { return false; } - return !!(this.activePluginId && (this.activePluginId === pluginId || getMainAppPluginId() === pluginId)); + const result = !!(this.activePluginId && (this.activePluginId === pluginId || getMainAppPluginId() === pluginId)); + reportInteraction('sidecar_service_is_app_opened', { pluginId, isOpened: result }); + return result; } } diff --git a/public/app/plugins/panel/nodeGraph/panelcfg.cue b/public/app/plugins/panel/nodeGraph/panelcfg.cue index 1f82a965df9..8630d2bdda3 100644 --- a/public/app/plugins/panel/nodeGraph/panelcfg.cue +++ b/public/app/plugins/panel/nodeGraph/panelcfg.cue @@ -43,12 +43,12 @@ composableKinds: PanelCfg: { // Unit for the secondary stat to override what ever is set in the data frame. secondaryStatUnit?: string } - ZoomMode: "cooperative" | "greedy" @cuetsy(kind="enum") + ZoomMode: "cooperative" | "greedy" @cuetsy(kind="enum") Options: { nodes?: NodeOptions edges?: EdgeOptions - // How to handle zoom/scroll events in the node graph - zoomMode?: ZoomMode + // How to handle zoom/scroll events in the node graph + zoomMode?: ZoomMode } @cuetsy(kind="interface") } }] diff --git a/public/app/plugins/panel/xychart/panelcfg.cue b/public/app/plugins/panel/xychart/panelcfg.cue index aadacc6c248..c16102b1f6e 100644 --- a/public/app/plugins/panel/xychart/panelcfg.cue +++ b/public/app/plugins/panel/xychart/panelcfg.cue @@ -45,7 +45,7 @@ composableKinds: PanelCfg: { show?: XYShowMode & (*"points" | _) - pointSize?: { + pointSize?: { fixed?: int32 & >=0 min?: int32 & >=0 max?: int32 & >=0 @@ -62,12 +62,12 @@ composableKinds: PanelCfg: { } @cuetsy(kind="interface",TSVeneer="type") XYSeriesConfig: { - name?: { fixed?: string } - frame?: { matcher: #MatcherConfig } - x?: { matcher: #MatcherConfig } - y?: { matcher: #MatcherConfig } - color?: { matcher: #MatcherConfig } - size?: { matcher: #MatcherConfig } + name?: {fixed?: string} + frame?: {matcher: #MatcherConfig} + x?: {matcher: #MatcherConfig} + y?: {matcher: #MatcherConfig} + color?: {matcher: #MatcherConfig} + size?: {matcher: #MatcherConfig} } @cuetsy(kind="interface") Options: {