How to configure Grafana alerts with Loki

33 views Asked by At

I have troubles configuring Grafana alerts with Loki. When I switch to the alerts page I always get the following: Failed to load rules config from Loki: API error

In the browser devtools I see: HTTP 400  bad request error

Here is the ruler part of my loki.yaml:

ruler:
  storage:
    type: local
    local:
      directory: /data/loki/rules
  rule_path: /data/loki/scratch
  alertmanager_url: http://alertmanager-operated.svc.cluster.local:9093
  ring:
    kvstore:
      store: inmemory
  enable_api: true
  enable_alertmanager_v2: true

What am I doing wrong?

1

There are 1 answers

0
yungkei On

You should first check loki api GET ~/loki/api/v1/rules give the correct response.