Difference between revisions of "Prometheus: alert:"
Jump to navigation
Jump to search
(16 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
* https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/ | * https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/ | ||
− | <> | + | groups: |
+ | - name: example | ||
+ | [[Prometheus, rules:|rules:]] | ||
+ | - alert: HighRequestLatency | ||
+ | expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5 | ||
+ | for: 10m | ||
+ | labels: | ||
+ | severity: page | ||
+ | annotations: | ||
+ | summary: High request latency | ||
+ | |||
+ | |||
+ | <pre> | ||
+ | <nowiki> | ||
alert: InstanceDown | alert: InstanceDown | ||
− | + | expr: up == 0 | |
for: 5m | for: 5m | ||
labels: | labels: | ||
Line 11: | Line 24: | ||
summary: "Instance {{$labels.instance}} down" | summary: "Instance {{$labels.instance}} down" | ||
description: "{{$labels.instance}} of job {{$labels.job}} has been down for more than 5 minutes." | description: "{{$labels.instance}} of job {{$labels.job}} has been down for more than 5 minutes." | ||
− | + | </nowiki> | |
+ | </pre> | ||
== Related == | == Related == | ||
* [[Alertmanager]] | * [[Alertmanager]] | ||
+ | * <code>[[expr:]]</code> | ||
+ | * [[Go template]]: https://pkg.go.dev/text/template | ||
+ | * <code>[[rule files:]]</code> | ||
== See also == | == See also == | ||
+ | * {{Alertmanager}} | ||
* {{Prometheus}} | * {{Prometheus}} | ||
[[Category:Monitoring]] | [[Category:Monitoring]] | ||
[[Category:Prometheus]] | [[Category:Prometheus]] |
Latest revision as of 08:09, 23 September 2022
groups: - name: example rules: - alert: HighRequestLatency expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5 for: 10m labels: severity: page annotations: summary: High request latency
alert: InstanceDown expr: up == 0 for: 5m labels: severity: page annotations: summary: "Instance {{$labels.instance}} down" description: "{{$labels.instance}} of job {{$labels.job}} has been down for more than 5 minutes."
Related[edit]
See also[edit]
- Prometheus Alertmanager:
amtool, alertmanager.yml, simple.yml
, Karma, versions, Signl4.com, Zenduty - Prometheus: Prometheus installation,
9090
, storage, Prometheus exporters: Node exporter9100
, Blackbox exporter, Prometheus alertmanager (changelog), Prometheus versions, Prometheus Node exporter releases,promtool
,amtool, tsdb
,/etc/default/prometheus, /etc/prometheus/prometheus.yml, journalctl -u prometheus
,/etc/default/prometheus-node-exporter
, PromQL,alert:
, Prometheus Operator, Thanos, VictoriaMetrics, PushGateway, Prometheus API,values.yml
, Amazon Managed Service for Prometheus
Advertising: