diff --git a/jsonnet/kube-prometheus/components/mixin/custom.libsonnet b/jsonnet/kube-prometheus/components/mixin/custom.libsonnet index 13c36332..d4f3d9d2 100644 --- a/jsonnet/kube-prometheus/components/mixin/custom.libsonnet +++ b/jsonnet/kube-prometheus/components/mixin/custom.libsonnet @@ -11,6 +11,7 @@ local defaults = { _config: { nodeExporterSelector: 'job="node-exporter"', hostNetworkInterfaceSelector: 'device!~"veth.+"', + runbookURLPattern: 'https://github.com/prometheus-operator/kube-prometheus/wiki/%s', }, }, }; @@ -21,9 +22,10 @@ function(params) { local alertsandrules = (import './alerts/alerts.libsonnet') + (import './rules/rules.libsonnet'), - mixin:: alertsandrules { - _config+:: m.config.mixin._config, - }, + mixin:: alertsandrules + + (import 'github.com/kubernetes-monitoring/kubernetes-mixin/alerts/add-runbook-links.libsonnet') { + _config+:: m.config.mixin._config, + }, prometheusRule: { apiVersion: 'monitoring.coreos.com/v1', diff --git a/manifests/kube-prometheus-prometheusRule.yaml b/manifests/kube-prometheus-prometheusRule.yaml index bb2cf6df..530dc0cd 100644 --- a/manifests/kube-prometheus-prometheusRule.yaml +++ b/manifests/kube-prometheus-prometheusRule.yaml @@ -16,6 +16,7 @@ spec: - alert: TargetDown annotations: message: '{{ printf "%.4g" $value }}% of the {{ $labels.job }}/{{ $labels.service }} targets in {{ $labels.namespace }} namespace are down.' + runbook_url: https://github.com/prometheus-operator/kube-prometheus/wiki/targetdown expr: 100 * (count(up == 0) BY (job, namespace, service) / count(up) BY (job, namespace, service)) > 10 for: 10m labels: @@ -28,6 +29,7 @@ spec: and always fire against a receiver. There are integrations with various notification mechanisms that send a notification when this alert is not firing. For example the "DeadMansSnitch" integration in PagerDuty. + runbook_url: https://github.com/prometheus-operator/kube-prometheus/wiki/watchdog expr: vector(1) labels: severity: none @@ -36,6 +38,7 @@ spec: - alert: NodeNetworkInterfaceFlapping annotations: message: Network interface "{{ $labels.device }}" changing it's up status often on node-exporter {{ $labels.namespace }}/{{ $labels.pod }} + runbook_url: https://github.com/prometheus-operator/kube-prometheus/wiki/nodenetworkinterfaceflapping expr: | changes(node_network_up{job="node-exporter",device!~"veth.+"}[2m]) > 2 for: 2m