Alert Rule invalid format of evaluation results for the alert definition

I deploying some grafana alerts using grafana operator helm chart, one of these alerts is a watchdog alert that always be firing in alertmanager to certify that is working properly
Accordin to grafana documentation, the kubernetes manifest is this
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaAlertRuleGroup
metadata:
name: prometheus-stack-kube-prom-general-grafana-rules
namespace: monitoring
spec:
folderRef: prometheus-stack-kube-prom-general-grafana-rules
instanceSelector:
matchLabels:
dashboards: “grafana”
interval: 1m
rules:
- uid: 589e3fbda213
title: Watchdog
condition: A
for: 1m
data:
- refId: A
relativeTimeRange:
from: 600
to: 0
datasourceUid: prometheus
model:
datasource:
type: prometheus
uid: prometheus
editorMode: code
expr: vector(1)
intervalMs: 1000
legendFormat: __auto
refId: A
- refId: B
datasourceUid: expr
model:
conditions:
- evaluator:
params:
type: gt
operator:
type: and
query:
params:
- B
reducer:
params:
type: last
type: query
datasource:
type: expr
uid: expr
expression: A
intervalMs: 1000
reducer: last
refId: B
type: reduce
noDataState: OK
execErrState: Error
labels:
severity: info
annotations:
summary: ‘An alert that should always be firing to certify that Alertmanager is working properly.’
description: ‘This is an alert meant to ensure that the entire alerting pipeline is functional. This alert is always firing, therefore it should always be firing in Alertmanager and always fire against a receiver.’
isPaused: false

When I apply the rule I got an error “invalid format of evaluation results for the alert definition A: looks like time series data, only reduced data can be alerted on.”

I try almost everything that I found looking for information and I keep with the same error

Hi,

Is this error mentioned in the logs of Grafana or in the alert rule page? Do you maybe have a screenshot of the alert (tbh it’s quite hard for me to decode the alert from yaml).

Hi Dawid that for answer, the error is in alert rule page, here there’re the screenshot


Can you go into edit mode and also provide screenshots (sorry, I could elaborate more :sweat_smile:). Mainly of the query and expressions (cross out sensitive data if there’s some).
I’m asking of that because it seems like you’re trying to alert on time series data - Grafana can only alert on numbers, so expression like Reduce should be used.

Dont worry, any help in this case is good jajaja :joy:

Ok, I see the problem - the alert condition (the one Grafana uses to evaluate alerts) is set to be the query, not the reduce expression (you might also want to have a threshold expression, becuase otherwise it will work as 0 - ok, anything else - firing).
What you need to change is from:

- uid: 589e3fbda213
  title: Watchdog
  condition: A
  for: 1m
  data:
...

to

- uid: 589e3fbda213
  title: Watchdog
  condition: B
  for: 1m
  data:
...

(condition should ref to B - the reduce expression).

Hope that’s it

Man, I thought that I did that,

Well it work, thank you, you are my hero

1 Like