flask api
prometheus:2.18.2
alertmanager:0.18.0
centos7.2 3.10.0-327.el7.x86_64
`cat prometheus.yml
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
external_labels:
monitor: 'codelab_monitor'
alerting:
alertmanagers:
api logs:
{u'status': u'firing', u'groupLabels': {u'alertname': u'InstanceDown'}, u'groupKey': u'{}:{alertname="InstanceDown"}', u'commonAnnotations': {u'description': u'192.168.20.58:9100 of job server has been down for more than 5 minutes.', u'summary': u'Instance 192.168.20.58:9100 down'}, u'alerts': [{u'status': u'firing', u'labels': {u'instance': u'192.168.20.58:9100', u'job': u'server', u'monitor': u'codelab_monitor', u'alertname': u'InstanceDown', u'severity': u'error'}, u'endsAt': u'0001-01-01T00:00:00Z', u'generatorURL': u'http://Lan-Kvm-20058-GuangSql:9090/graph?g0.expr=up+%3D%3D+0&g0.tab=1', u'startsAt': u'2020-09-17T02:45:3 5.904147407Z', u'annotations': {u'description': u'192.168.20.58:9100 of job server has been down for more than 5 minutes.', u'summary': u'Instance 192.168.20.58:9100 down'}}], u'version': u'4', u'receiver': u'web\\.hook', u'externalURL': u'http://Lan-Kvm-20058-GuangSql:9093', u'commonLabels': {u'instance': u'192.168.20.58:9100', u'job': u'server', u'monitor': u'codelab_monitor', u'alertname': u'InstanceDown', u'severity': u'error'}}
flask api prometheus:2.18.2 alertmanager:0.18.0 centos7.2 3.10.0-327.el7.x86_64
`cat prometheus.yml global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. external_labels: monitor: 'codelab_monitor' alerting: alertmanagers:
rule_files:
- "second_rules.yml"
scrape_configs:
job_name: 'prometheus'
static_configs:
job_name: 'pushgateway' honor_labels: true static_configs:
job_name: 'server' static_configs:
`cat alertmanager.yml global: resolve_timeout: 5m
templates:
route: group_by: ['alertname'] group_wait: 10s group_interval: 10s repeat_interval: 1h receiver: 'web.hook' receivers:
inhibit_rules:
alertmanager logs:
alertmanager: {"aggrGroup":"{}:{alertname=\"InstanceDown\"}","alerts":"[InstanceDown[34c8542][resolved]]","caller":"dispatch.go:430","component":"dispatcher","level":"debug","msg":"flushing","ts":"2020-09-17T03:01:50.911Z"}
api logs:
{u'status': u'firing', u'groupLabels': {u'alertname': u'InstanceDown'}, u'groupKey': u'{}:{alertname="InstanceDown"}', u'commonAnnotations': {u'description': u'192.168.20.58:9100 of job server has been down for more than 5 minutes.', u'summary': u'Instance 192.168.20.58:9100 down'}, u'alerts': [{u'status': u'firing', u'labels': {u'instance': u'192.168.20.58:9100', u'job': u'server', u'monitor': u'codelab_monitor', u'alertname': u'InstanceDown', u'severity': u'error'}, u'endsAt': u'0001-01-01T00:00:00Z', u'generatorURL': u'http://Lan-Kvm-20058-GuangSql:9090/graph?g0.expr=up+%3D%3D+0&g0.tab=1', u'startsAt': u'2020-09-17T02:45:3 5.904147407Z', u'annotations': {u'description': u'192.168.20.58:9100 of job server has been down for more than 5 minutes.', u'summary': u'Instance 192.168.20.58:9100 down'}}], u'version': u'4', u'receiver': u'web\\.hook', u'externalURL': u'http://Lan-Kvm-20058-GuangSql:9093', u'commonLabels': {u'instance': u'192.168.20.58:9100', u'job': u'server', u'monitor': u'codelab_monitor', u'alertname': u'InstanceDown', u'severity': u'error'}}
status resolved no data received ?