Add runbook_url annotation for custom mixins
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
This commit is contained in:
@@ -11,6 +11,7 @@ local defaults = {
|
|||||||
_config: {
|
_config: {
|
||||||
nodeExporterSelector: 'job="node-exporter"',
|
nodeExporterSelector: 'job="node-exporter"',
|
||||||
hostNetworkInterfaceSelector: 'device!~"veth.+"',
|
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'),
|
local alertsandrules = (import './alerts/alerts.libsonnet') + (import './rules/rules.libsonnet'),
|
||||||
|
|
||||||
mixin:: alertsandrules {
|
mixin:: alertsandrules +
|
||||||
_config+:: m.config.mixin._config,
|
(import 'github.com/kubernetes-monitoring/kubernetes-mixin/alerts/add-runbook-links.libsonnet') {
|
||||||
},
|
_config+:: m.config.mixin._config,
|
||||||
|
},
|
||||||
|
|
||||||
prometheusRule: {
|
prometheusRule: {
|
||||||
apiVersion: 'monitoring.coreos.com/v1',
|
apiVersion: 'monitoring.coreos.com/v1',
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ spec:
|
|||||||
- alert: TargetDown
|
- alert: TargetDown
|
||||||
annotations:
|
annotations:
|
||||||
message: '{{ printf "%.4g" $value }}% of the {{ $labels.job }}/{{ $labels.service }} targets in {{ $labels.namespace }} namespace are down.'
|
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
|
expr: 100 * (count(up == 0) BY (job, namespace, service) / count(up) BY (job, namespace, service)) > 10
|
||||||
for: 10m
|
for: 10m
|
||||||
labels:
|
labels:
|
||||||
@@ -28,6 +29,7 @@ spec:
|
|||||||
and always fire against a receiver. There are integrations with various notification
|
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
|
mechanisms that send a notification when this alert is not firing. For example the
|
||||||
"DeadMansSnitch" integration in PagerDuty.
|
"DeadMansSnitch" integration in PagerDuty.
|
||||||
|
runbook_url: https://github.com/prometheus-operator/kube-prometheus/wiki/watchdog
|
||||||
expr: vector(1)
|
expr: vector(1)
|
||||||
labels:
|
labels:
|
||||||
severity: none
|
severity: none
|
||||||
@@ -36,6 +38,7 @@ spec:
|
|||||||
- alert: NodeNetworkInterfaceFlapping
|
- alert: NodeNetworkInterfaceFlapping
|
||||||
annotations:
|
annotations:
|
||||||
message: Network interface "{{ $labels.device }}" changing it's up status often on node-exporter {{ $labels.namespace }}/{{ $labels.pod }}
|
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: |
|
expr: |
|
||||||
changes(node_network_up{job="node-exporter",device!~"veth.+"}[2m]) > 2
|
changes(node_network_up{job="node-exporter",device!~"veth.+"}[2m]) > 2
|
||||||
for: 2m
|
for: 2m
|
||||||
|
|||||||
Reference in New Issue
Block a user