From 97db8b19c7c56ca52a3cbe873af1da8e24bb8bac Mon Sep 17 00:00:00 2001 From: Sam Jewell <2903904+samjewell@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:50:33 +0000 Subject: [PATCH] [Prometheus]: Mark ALERTS synthetic metric as a gauge (#99328) Mark ALERTS synthetic metric as a gauge It's not a counter. It can go down in value, but counters cannot --- packages/grafana-prometheus/src/language_utils.test.ts | 2 +- packages/grafana-prometheus/src/language_utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grafana-prometheus/src/language_utils.test.ts b/packages/grafana-prometheus/src/language_utils.test.ts index 6c536879fc6..399fc88862f 100644 --- a/packages/grafana-prometheus/src/language_utils.test.ts +++ b/packages/grafana-prometheus/src/language_utils.test.ts @@ -91,7 +91,7 @@ describe('parseSelector()', () => { describe('fixSummariesMetadata', () => { const synthetics = { ALERTS: { - type: 'counter', + type: 'gauge', help: 'Time series showing pending and firing alerts. The sample value is set to 1 as long as the alert is in the indicated active (pending or firing) state.', }, }; diff --git a/packages/grafana-prometheus/src/language_utils.ts b/packages/grafana-prometheus/src/language_utils.ts index 69e1a2ccad8..87f03f4dc82 100644 --- a/packages/grafana-prometheus/src/language_utils.ts +++ b/packages/grafana-prometheus/src/language_utils.ts @@ -323,7 +323,7 @@ export function fixSummariesMetadata(metadata: { [metric: string]: PromMetricsMe // Synthetic series const syntheticMetadata: PromMetricsMetadata = {}; syntheticMetadata['ALERTS'] = { - type: 'counter', + type: 'gauge', help: 'Time series showing pending and firing alerts. The sample value is set to 1 as long as the alert is in the indicated active (pending or firing) state.', };