diff --git a/grafana-plugin/src/dashboards/oncall_metrics_dashboard.json b/grafana-plugin/src/dashboards/oncall_metrics_dashboard.json index aa424065..1296babb 100644 --- a/grafana-plugin/src/dashboards/oncall_metrics_dashboard.json +++ b/grafana-plugin/src/dashboards/oncall_metrics_dashboard.json @@ -182,7 +182,7 @@ "editorMode": "code", "excludeNullMetadata": false, "exemplar": false, - "expr": "round(delta(sum($alert_groups_total{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"})[$__range:])) >= 0", + "expr": "round(delta(sum($alert_groups_total{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`})[$__range:])) >= 0", "format": "time_series", "fullMetaSearch": false, "includeNullMetadata": true, @@ -266,7 +266,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "avg_over_time((sum($alert_groups_response_time_seconds_sum{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"}) / sum($alert_groups_response_time_seconds_count{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"}))[$__range:])", + "expr": "avg_over_time((sum($alert_groups_response_time_seconds_sum{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`}) / sum($alert_groups_response_time_seconds_count{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`}))[$__range:])", "instant": true, "legendFormat": "__auto", "range": false, @@ -389,7 +389,7 @@ "editorMode": "code", "excludeNullMetadata": false, "exemplar": false, - "expr": "round(delta(sum by (integration) ($alert_groups_total{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"})[$__interval:])) >= 0", + "expr": "round(delta(sum by (integration) ($alert_groups_total{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`})[$__interval:])) >= 0", "fullMetaSearch": false, "hide": false, "instant": false, @@ -507,7 +507,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "avg(sum($alert_groups_response_time_seconds_sum{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"}) / sum($alert_groups_response_time_seconds_count{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"}))", + "expr": "avg(sum($alert_groups_response_time_seconds_sum{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`}) / sum($alert_groups_response_time_seconds_count{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`}))", "instant": false, "legendFormat": "__auto", "range": true, @@ -613,7 +613,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sort_desc(round(delta(sum by (integration)($alert_groups_total{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"})[$__range:])) >= 0)", + "expr": "sort_desc(round(delta(sum by (integration)($alert_groups_total{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`})[$__range:])) >= 0)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -729,7 +729,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sort_desc(avg_over_time((sum by (integration)($alert_groups_response_time_seconds_sum{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"}) / sum by (integration)($alert_groups_response_time_seconds_count{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"}))[$__range:]))", + "expr": "sort_desc(avg_over_time((sum by (integration)($alert_groups_response_time_seconds_sum{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`}) / sum by (integration)($alert_groups_response_time_seconds_count{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`}))[$__range:]))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -862,7 +862,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sort_desc(round(delta(sum by (team)($alert_groups_total{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"})[$__range:])) >= 0)", + "expr": "sort_desc(round(delta(sum by (team)($alert_groups_total{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`})[$__range:])) >= 0)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -979,7 +979,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sort_desc(avg_over_time((sum by(team) ($alert_groups_response_time_seconds_sum{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"}) / sum by(team)($alert_groups_response_time_seconds_count{slug=~\"$instance\", team=~\"$team\", integration=~\"$integration\", service_name=~\"$service_name\"}))[$__range:]))", + "expr": "sort_desc(avg_over_time((sum by(team) ($alert_groups_response_time_seconds_sum{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`}) / sum by(team)($alert_groups_response_time_seconds_count{slug=~`$instance`, team=~`$team`, integration=~`$integration`, service_name=~`$service_name`}))[$__range:]))", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1129,7 +1129,7 @@ "editorMode": "code", "excludeNullMetadata": false, "exemplar": false, - "expr": "round(delta(sum by (username)($user_was_notified_of_alert_groups_total{slug=~\"$instance\"})[$__interval:])) >= 0", + "expr": "round(delta(sum by (username)($user_was_notified_of_alert_groups_total{slug=~`$instance`})[$__interval:])) >= 0", "fullMetaSearch": false, "instant": false, "legendFormat": "__auto", @@ -1222,7 +1222,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sort_desc(round(delta(sum by (username)($user_was_notified_of_alert_groups_total{slug=~\"$instance\"})[$__range:])) >= 0)", + "expr": "sort_desc(round(delta(sum by (username)($user_was_notified_of_alert_groups_total{slug=~`$instance`})[$__range:])) >= 0)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1430,7 +1430,7 @@ "type": "prometheus", "uid": "${datasource}" }, - "definition": "label_values(${alert_groups_total}{slug=~\"$instance\"},team)", + "definition": "label_values(${alert_groups_total}{slug=~`$instance`},team)", "hide": 0, "includeAll": true, "label": "Team", @@ -1438,7 +1438,7 @@ "name": "team", "options": [], "query": { - "query": "label_values(${alert_groups_total}{slug=~\"$instance\"},team)", + "query": "label_values(${alert_groups_total}{slug=~`$instance`},team)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 2, @@ -1458,7 +1458,7 @@ "type": "prometheus", "uid": "${datasource}" }, - "definition": "label_values(${alert_groups_total}{team=~\"$team\",slug=~\"$instance\"},integration)", + "definition": "label_values(${alert_groups_total}{team=~`$team`,slug=~`$instance`},integration)", "hide": 0, "includeAll": true, "label": "Integration", @@ -1466,7 +1466,7 @@ "name": "integration", "options": [], "query": { - "query": "label_values(${alert_groups_total}{team=~\"$team\",slug=~\"$instance\"},integration)", + "query": "label_values(${alert_groups_total}{team=~`$team`,slug=~`$instance`},integration)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 2, @@ -1486,7 +1486,7 @@ "type": "prometheus", "uid": "${datasource}" }, - "definition": "label_values(${alert_groups_total}{slug=~\"$instance\", team=~\"$team\"},service_name)", + "definition": "label_values(${alert_groups_total}{slug=~`$instance`, team=~`$team`},service_name)", "hide": 0, "includeAll": true, "label": "Service name", @@ -1495,7 +1495,7 @@ "options": [], "query": { "qryType": 1, - "query": "label_values(${alert_groups_total}{slug=~\"$instance\", team=~\"$team\"},service_name)", + "query": "label_values(${alert_groups_total}{slug=~`$instance`, team=~`$team`},service_name)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 2, @@ -1516,7 +1516,7 @@ }, "timezone": "browser", "title": "OnCall Insights", - "version": 3, - "revision": 3, + "version": 4, + "revision": 4, "weekStart": "" } diff --git a/grafana-plugin/src/pages/insights/scenes/AlertGroupsByIntegration.tsx b/grafana-plugin/src/pages/insights/scenes/AlertGroupsByIntegration.tsx index fdc194d5..0425a62a 100644 --- a/grafana-plugin/src/pages/insights/scenes/AlertGroupsByIntegration.tsx +++ b/grafana-plugin/src/pages/insights/scenes/AlertGroupsByIntegration.tsx @@ -10,7 +10,7 @@ export function getAlertGroupsByIntegrationScene({ datasource, stack }: Insights { editorMode: 'code', exemplar: false, - expr: `sort_desc(round(delta(sum by (integration)($alert_groups_total{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"})[$__range:])) >= 0)`, + expr: `sort_desc(round(delta(sum by (integration)($alert_groups_total{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`})[$__range:])) >= 0)`, format: 'table', instant: true, legendFormat: '__auto', diff --git a/grafana-plugin/src/pages/insights/scenes/AlertGroupsByTeam.tsx b/grafana-plugin/src/pages/insights/scenes/AlertGroupsByTeam.tsx index 43352671..b73c6a36 100644 --- a/grafana-plugin/src/pages/insights/scenes/AlertGroupsByTeam.tsx +++ b/grafana-plugin/src/pages/insights/scenes/AlertGroupsByTeam.tsx @@ -10,7 +10,7 @@ export function getAlertGroupsByTeamScene({ datasource, stack }: InsightsConfig) { editorMode: 'code', exemplar: false, - expr: `sort_desc(round(delta(sum by (team)($alert_groups_total{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"})[$__range:])) >= 0)`, + expr: `sort_desc(round(delta(sum by (team)($alert_groups_total{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`})[$__range:])) >= 0)`, format: 'table', instant: true, legendFormat: '__auto', diff --git a/grafana-plugin/src/pages/insights/scenes/MTTRAverageStat.tsx b/grafana-plugin/src/pages/insights/scenes/MTTRAverageStat.tsx index 5f61359b..e00e8567 100644 --- a/grafana-plugin/src/pages/insights/scenes/MTTRAverageStat.tsx +++ b/grafana-plugin/src/pages/insights/scenes/MTTRAverageStat.tsx @@ -10,7 +10,7 @@ export function getMTTRAverage({ datasource, stack }: InsightsConfig) { { editorMode: 'code', exemplar: false, - expr: `avg_over_time((sum($alert_groups_response_time_seconds_sum{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"}) / sum($alert_groups_response_time_seconds_count{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"}))[$__range:])`, + expr: `avg_over_time((sum($alert_groups_response_time_seconds_sum{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`}) / sum($alert_groups_response_time_seconds_count{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`}))[$__range:])`, instant: true, legendFormat: '__auto', range: false, diff --git a/grafana-plugin/src/pages/insights/scenes/MTTRByIntegration.tsx b/grafana-plugin/src/pages/insights/scenes/MTTRByIntegration.tsx index aab2c746..2e5346f6 100644 --- a/grafana-plugin/src/pages/insights/scenes/MTTRByIntegration.tsx +++ b/grafana-plugin/src/pages/insights/scenes/MTTRByIntegration.tsx @@ -10,7 +10,7 @@ export function getMTTRByIntegrationScene({ datasource, stack }: InsightsConfig) { editorMode: 'code', exemplar: false, - expr: `sort_desc(avg_over_time((sum by (integration)($alert_groups_response_time_seconds_sum{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"}) / sum by (integration)($alert_groups_response_time_seconds_count{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"}))[$__range:]))`, + expr: `sort_desc(avg_over_time((sum by (integration)($alert_groups_response_time_seconds_sum{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`}) / sum by (integration)($alert_groups_response_time_seconds_count{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`}))[$__range:]))`, format: 'table', instant: true, legendFormat: '__auto', diff --git a/grafana-plugin/src/pages/insights/scenes/MTTRByTeam.tsx b/grafana-plugin/src/pages/insights/scenes/MTTRByTeam.tsx index d86fcedb..90f22fde 100644 --- a/grafana-plugin/src/pages/insights/scenes/MTTRByTeam.tsx +++ b/grafana-plugin/src/pages/insights/scenes/MTTRByTeam.tsx @@ -10,7 +10,7 @@ export function getMTTRByTeamScene({ datasource, stack }: InsightsConfig) { { editorMode: 'code', exemplar: false, - expr: `sort_desc(avg_over_time((sum by(team) ($alert_groups_response_time_seconds_sum{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"}) / sum by(team)($alert_groups_response_time_seconds_count{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"}))[$__range:]))`, + expr: `sort_desc(avg_over_time((sum by(team) ($alert_groups_response_time_seconds_sum{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`}) / sum by(team)($alert_groups_response_time_seconds_count{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`}))[$__range:]))`, format: 'table', instant: true, legendFormat: '__auto', diff --git a/grafana-plugin/src/pages/insights/scenes/MTTRChangedTimeseries.tsx b/grafana-plugin/src/pages/insights/scenes/MTTRChangedTimeseries.tsx index 1614bbb6..cedc5f05 100644 --- a/grafana-plugin/src/pages/insights/scenes/MTTRChangedTimeseries.tsx +++ b/grafana-plugin/src/pages/insights/scenes/MTTRChangedTimeseries.tsx @@ -10,7 +10,7 @@ export function getMTTRChangedTimeseriesScene({ datasource, stack }: InsightsCon { editorMode: 'code', exemplar: false, - expr: `avg(sum($alert_groups_response_time_seconds_sum{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"}) / sum($alert_groups_response_time_seconds_count{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"}))`, + expr: `avg(sum($alert_groups_response_time_seconds_sum{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`}) / sum($alert_groups_response_time_seconds_count{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`}))`, instant: false, legendFormat: '__auto', range: true, diff --git a/grafana-plugin/src/pages/insights/scenes/NewAlertGroups.tsx b/grafana-plugin/src/pages/insights/scenes/NewAlertGroups.tsx index ab187c24..b044de94 100644 --- a/grafana-plugin/src/pages/insights/scenes/NewAlertGroups.tsx +++ b/grafana-plugin/src/pages/insights/scenes/NewAlertGroups.tsx @@ -12,7 +12,7 @@ export function getNewAlertGroupsScene({ datasource, stack }: InsightsConfig) { editorMode: 'code', excludeNullMetadata: false, exemplar: false, - expr: `round(delta(sum($alert_groups_total{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"})[$__range:])) >= 0`, + expr: `round(delta(sum($alert_groups_total{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`})[$__range:])) >= 0`, format: 'time_series', fullMetaSearch: false, includeNullMetadata: true, diff --git a/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsNotificationsTable.tsx b/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsNotificationsTable.tsx index f6d9e7ba..48e79ce9 100644 --- a/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsNotificationsTable.tsx +++ b/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsNotificationsTable.tsx @@ -10,7 +10,7 @@ export function getNewAlertGroupsNotificationsTableScene({ datasource, stack }: { editorMode: 'code', exemplar: false, - expr: `sort_desc(round(delta(sum by (username)($user_was_notified_of_alert_groups_total{slug=~"${stack}"})[$__range:])) >= 0)`, + expr: `sort_desc(round(delta(sum by (username)($user_was_notified_of_alert_groups_total{slug=~\`${stack}\`})[$__range:])) >= 0)`, format: 'table', instant: true, legendFormat: '__auto', diff --git a/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsNotificationsTimeseries.tsx b/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsNotificationsTimeseries.tsx index bc2ae156..f97b111c 100644 --- a/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsNotificationsTimeseries.tsx +++ b/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsNotificationsTimeseries.tsx @@ -13,7 +13,7 @@ export function getNewAlertGroupsNotificationsTimeseriesScene({ datasource, stac editorMode: 'code', excludeNullMetadata: false, exemplar: false, - expr: `round(delta(sum by (username)($user_was_notified_of_alert_groups_total{slug=~"${stack}"})[$__interval:])) >= 0`, + expr: `round(delta(sum by (username)($user_was_notified_of_alert_groups_total{slug=~\`${stack}\`})[$__interval:])) >= 0`, fullMetaSearch: false, instant: false, legendFormat: '__auto', diff --git a/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsTimeseries.tsx b/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsTimeseries.tsx index cd556708..0f1adab9 100644 --- a/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsTimeseries.tsx +++ b/grafana-plugin/src/pages/insights/scenes/NewAlertGroupsTimeseries.tsx @@ -13,7 +13,7 @@ export function getNewAlertGroupsTimeseriesScene({ datasource, stack }: Insights editorMode: 'code', excludeNullMetadata: false, exemplar: false, - expr: `round(delta(sum by (integration)($alert_groups_total{slug=~"${stack}", team=~"$team", integration=~"$integration", service_name=~"$service_name"})[$__interval:])) >= 0`, + expr: `round(delta(sum by (integration)($alert_groups_total{slug=~\`${stack}\`, team=~\`$team\`, integration=~\`$integration\`, service_name=~\`$service_name\`})[$__interval:])) >= 0`, fullMetaSearch: false, instant: false, legendFormat: '__auto', diff --git a/grafana-plugin/src/pages/insights/variables.ts b/grafana-plugin/src/pages/insights/variables.ts index b8dbd6e2..9dd28021 100644 --- a/grafana-plugin/src/pages/insights/variables.ts +++ b/grafana-plugin/src/pages/insights/variables.ts @@ -34,9 +34,9 @@ const getVariables = ({ isOpenSource, datasource, stack }: InsightsConfig) => ({ text: ['All'], value: ['$__all'], datasource, - definition: `label_values(\${alert_groups_total}{slug=~"${stack}"},team)`, + definition: `label_values(\${alert_groups_total}{slug=~\`${stack}\`},team)`, query: { - query: `label_values(\${alert_groups_total}{slug=~"${stack}"},team)`, + query: `label_values(\${alert_groups_total}{slug=~\`${stack}\`},team)`, refId: 'PrometheusVariableQueryEditor-VariableQuery', }, refresh: 2, @@ -48,9 +48,9 @@ const getVariables = ({ isOpenSource, datasource, stack }: InsightsConfig) => ({ text: ['All'], value: ['$__all'], datasource, - definition: `label_values(\${alert_groups_total}{team=~"$team",slug=~"${stack}"},integration)`, + definition: `label_values(\${alert_groups_total}{team=~\`$team\`,slug=~\`${stack}\`},integration)`, query: { - query: `label_values(\${alert_groups_total}{team=~"$team",slug=~"${stack}"},integration)`, + query: `label_values(\${alert_groups_total}{team=~\`$team\`,slug=~\`${stack}\`},integration)`, refId: 'PrometheusVariableQueryEditor-VariableQuery', }, refresh: 2, @@ -63,9 +63,9 @@ const getVariables = ({ isOpenSource, datasource, stack }: InsightsConfig) => ({ value: ['$__all'], allValue: '($^)|(.+)', datasource, - definition: `label_values(\${alert_groups_total}{slug=~"${stack}",team=~"$team"},service_name)`, + definition: `label_values(\${alert_groups_total}{slug=~\`${stack}\`,team=~\`$team\`},service_name)`, query: { - query: `label_values(\${alert_groups_total}{slug=~"${stack}",team=~"$team"},service_name)`, + query: `label_values(\${alert_groups_total}{slug=~\`${stack}\`,team=~\`$team\`},service_name)`, refId: 'PrometheusVariableQueryEditor-VariableQuery', }, refresh: 2,