Hello, can someone help me figure it out where is the problem in my loki ruler config? I am using s3 as chunks storage but want to use local for rules.
- Using single tenant.
- Using helm chart loki-5.14.1.
Below my ruler block config:
ruler:
alertmanager_url: http://alertmanager.monitoring.svc.cluster.local:9093
enable_alertmanager_v2: true
enable_api: true
ring:
kvstore:
store: inmemory
rule_path: "/rules"
storage:
local:
directory: /var/loki/rules
type: local
On the read component in values.yaml i have the volumes mounted:
extraVolumeMounts:
- name: loki-rules
mountPath: "/var/loki/rules/fake"
extraVolumes:
- name: loki-rules
configMap:
name: loki-alerting-rules
Have a configmap deployed and mapped to the rules.yaml:
cat /loki/rules/fake/rules.yaml
groups:
- name: high_error_rate
rules:
- alert: LokiHighErrorRate
expr: sum(rate({cluster="loki"} | logfmt | level="info"[1m])) by (container) > 0
for: 1m
labels:
severity: warning
annotations:
summary: Loki error per minute rate > 0
message: 'Loki warning per minute rate > 0 container:"{{ $labels.container }}"'
There are no errors on logs, but rule seems not to be evaluated and nothing is writeen in rule_path “/rules” and no alarms are raised.
Can someone help on this?
Thanks