-
What Grafana version and what operating system are you using?
9.1.6-oss -
What are you trying to achieve?
Alert rules being provisioned with yaml files -
How are you trying to achieve it?
Putalerts.yaml
to/etc/grafana/provisioning/alerting
-
What happened?
Error when trying to execute the rule
failed to execute query A: bad_data: 1:1: parse error: no expression found in input
-
What did you expect to happen?
Execution alert w/o error -
Can you copy/paste the configuration(s) that you are having problems with?
rules:
- uid: my_id_1
title: test_rule
for: 60s
labels:
severity: critical
annotations:
summary: Pod {{ $labels.pod }} is not in running state
condition: A
data:
- datasourceUid: prom0
model:
conditions:
- evaluator:
params:
- 0
- 0
type: gt
operator:
type: and
query:
params: []
reducer:
params: []
type: max
type: query
datasource:
type: __expr__
uid: __expr__
expression: count(kube_pod_status_phase{namespace=~"cloud-.*", job="kube-state-metrics",phase!="Running"}
== 1) by (pod, phase)
hide: false
intervalMs: 1000
maxDataPoints: 43200
refId: A
type: math
queryType: ''
refId: A
relativeTimeRange:
from: 600
to: 0
- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
logger=tsdb.prometheus t=2022-10-03T07:26:00.002945796Z level=error msg="Range query failed" query= err="bad_data: 1:1: parse error: no expression found in input"
logger=ngalert uid=my_id_1 org=1 version=1 attempt=0 now=2022-10-03T07:26:00Z t=2022-10-03T07:26:00.003021866Z level=error msg="failed to evaluate alert rule" results="[{Instance: State:Error Error:failed to execute conditions: failed to execute query A: bad_data: 1:1: parse error: no expression found in input EvaluatedAt:2022-10-03 07:26:00 +0000 UTC EvaluationDuration:3.017576ms EvaluationString: Values:map[]}]" duration=2.416376ms
- Did you follow any online instructions? If so, what is the URL?
Provision Grafana | Grafana documentation