using docker to set loki 2.4.1, can get log record from promtail. but can not sent any alert afte I set rule. and check my alertmanager no any information from loki, is there any wrong in my config file? thanks
docker-compose content with loki
loki:
image: grafana/loki:2.4.1
volumes:
- ./config/loki/rules:/etc/loki/rules
- ./config/loki/local-config.yaml:/etc/loki/local-config.yaml
- ./data/loki_data:/loki
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml -log.level=debug
networks:
- back-tier
/etc/loki/local-config.yaml
auth_enabled: false
server:
http_listen_port: 3100
common:
path_prefix: /loki
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
replication_factor: 1
ring:
instance_addr: 127.0.0.1
kvstore:
store: inmemory
schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
ruler:
alertmanager_url: http://alertmanager:9093
storage:
type: local
local:
directory: /tmp/rules
rule_path: /etc/loki/rules
ring:
kvstore:
store: inmemory
enable_api: true
enable_alertmanager_v2: true
/etc/loki/rules/energy_upload.yml
- name: energy_upload
rules:
- alert: energy_upload
annotations:
message: "检查防火墙能耗上传数据包失败,检查能耗软件是否正常工作."
expr: 'count_over_time({job="enerygy-consume"}[1m]) < 1'
for: 5m
labels:
severity: critical