Alert rules provisioning question

  • 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?
    Put alerts.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

Hi I also have the same issue, trying to execute the alert without an error. I get the same error as above. Helm chart used grafana-6.40.3, App Version 9.1.7
- refId: A
queryType: ‘’
datasourceUid: ‘P067175A64D1E8E5E’
relativeTimeRange: {“from”: 600,“to”: 0}
model:
expression: (sum(rate(istio_requests_total{reporter=“destination”, response_code=~“5.*”, destination_workload_namespace=~“vn-dev”}[2m])) by (destination_workload) / sum(rate(istio_requests_total{reporter=“destination”, destination_workload_namespace=~“vn-dev”}[2m])) by (destination_workload))
intervalMs: 1000
range: true
hide: false
maxDataPoints: 43200
refId: A
- refId: B
datasourceUid: ‘-100’
queryType: ‘’
model:
conditions:
- evaluator:
params:
- 0.1
type: gt
operator:
type: and
query:
params:
- A
reducer:
type: last
type: query
datasource:
type: expr
uid: ‘-100’
expression: A
intervalMs: 1000
hide: false
maxDataPoints: 43200
refId: B
type: classic_conditions

        noDataState: NoData
        for: 360s
        annotations:
          value: value
        labels:
          severity: critical