Skip to content

Instantly share code, notes, and snippets.

@wzhliang
Created January 25, 2019 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wzhliang/d2f72d0c7b528fc91fca0829d862a781 to your computer and use it in GitHub Desktop.
Save wzhliang/d2f72d0c7b528fc91fca0829d862a781 to your computer and use it in GitHub Desktop.
Prometheus operator alert rule
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
prometheus: service-prometheus
role: alert-rules
name: prometheus-service-rules
namespace: monitoring
spec:
groups:
- name: general.rules
rules:
- alert: TargetDown-serviceprom
annotations:
description: '{{ $value }}% of {{ $labels.job }} targets are down.'
summary: Targets are down
expr: 100 * (count(up == 0) BY (job) / count(up) BY (job)) > 10
for: 10m
labels:
severity: warning
- alert: DeadMansSwitch-serviceprom
annotations:
description: This is a DeadMansSwitch meant to ensure that the entire Alerting
pipeline is functional.
summary: Alerting DeadMansSwitch
expr: vector(1)
labels:
severity: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment