--log.level=debuglevel=debug ts=2018-11-05T09:11:22.971655651Z caller=dispatch.go:445 component=dispatcher aggrGroup={}:{} msg=Flushing alerts=[highCpuUsage[342bfd3][active]]level=debug ts=2018-11-05T09:11:23.579966911Z caller=dispatch.go:201 component=dispatcher msg="Received alert" alert=highCpuUsage[342bfd3][active]level=debug ts=2018-11-05T09:11:23.971970436Z caller=dispatch.go:445 component=dispatcher aggrGroup={}:{} msg=Flushing alerts=[highCpuUsage[342bfd3][active]]# my global configglobal: scrape_interval: 1s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 1s # Evaluate rules every 15 seconds. The default is every 1 minute. # scrape_timeout is set to the global default (10s).
# Alertmanager configurationalerting: alertmanagers: - static_configs: - targets: ['localhost:9093'] # - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.rule_files: - "cpu_rules.yml" # - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus itself.scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. - job_name: 'prometheus'
# metrics_path defaults to '/metrics' # scheme defaults to 'http'.
static_configs: - targets: ['localhost:9090']
- job_name: 'alertmanager' static_configs: - targets: ['localhost:9093']
- job_name: 'cpu' static_configs: - targets: ['localhost:9177']
groups:- name: lab rules: - alert: highCpuUsage expr: rate(libvirt_cpu_stats_user_time_nanosecs[1m])/10000000 > 40 labels: severity: critical annotations: title: "High cpu usage" description: | "High cpu usage on instance"
global: resolve_timeout: 5m
route: group_by: ['state'] group_wait: 1s group_interval: 1s repeat_interval: 1h receiver: admin_userreceivers:- name: 'admin_user' webhook_configs: - url: 'http://127.0.0.1:8999/v1/event' send_resolved: true http_config: basic_auth: username: 'admin' password: 'admin'
inhibit_rules: - source_match: severity: 'critical' target_match: severity: 'warning' equal: ['alertname', 'dev', 'instance']