Skip to content

Commit

Permalink
feat: set up alerts for a smooth Prom3 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
machine424 committed Jan 8, 2025
1 parent 0264620 commit ee2edf7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
16 changes: 16 additions & 0 deletions assets/cluster-monitoring-operator/prometheus-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@ spec:
for: 15m
labels:
severity: warning
- alert: TargetInvalidContentType
annotations:
description: Prometheus {{$labels.namespace}}/{{$labels.pod}} could not determine a valid content type for some scrape targets.
summary: A valid content type could not be determined for some scrape targets.
expr: increase(prometheus_target_scrape_pool_invalid_content_type_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m]) > 0
for: 15m
labels:
severity: critical
- alert: NarrowLeQuantileSelectors
annotations:
description: XXX.
summary: XXX.
expr: increase(prometheus_target_scrape_pool_invalid_content_type_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m]) > 0
for: 15m
labels:
severity: critical
- name: openshift-kubernetes.rules
rules:
- expr: sum(rate(container_cpu_usage_seconds_total{container="",pod!=""}[5m])) BY (pod, namespace)
Expand Down
26 changes: 26 additions & 0 deletions jsonnet/rules.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,32 @@ function(params) {
severity: 'warning',
},
},
{
expr: 'increase(prometheus_target_scrape_pool_invalid_content_type_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m]) > 0',
alert: 'TargetInvalidContentType',
'for': '15m',
annotations: {
description: 'Prometheus {{$labels.namespace}}/{{$labels.pod}} could not determine a valid content type for some scrape targets.',
summary: 'A valid content type could not be determined for some scrape targets.',
},
labels: {
# severity: 'warning', (before the cut, to take advantage of critical alerts treatment)
severity: 'critical',
},
},
{
expr: 'increase(prometheus_target_scrape_pool_invalid_content_type_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m]) > 0',
alert: 'NarrowLeQuantileSelectors',
'for': '15m',
annotations: {
description: 'XXX.',
summary: 'XXX.',
},
labels: {
# severity: 'warning', (before the cut, to take advantage of critical alerts treatment)
severity: 'critical',
},
},
],
},
{
Expand Down

0 comments on commit ee2edf7

Please sign in to comment.