Skip to content

Commit

Permalink
feat: set up the NarrowSelectorsOnIntegers alert for a smooth Prom3 u…
Browse files Browse the repository at this point in the history
…pgrade
  • Loading branch information
machine424 committed Jan 10, 2025
1 parent 0264620 commit 78dc30b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 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,16 @@ spec:
for: 15m
labels:
severity: warning
- alert: NarrowSelectorsOnIntegers
annotations:
description: Queries to Prometheus {{$labels.namespace}}/{{$labels.pod}} could be too restrictive.
summary: |
Some queries with selectors on the values of the "le" label of classic histograms or/and the "quantile" label of summaries
may not take into account that values could also be floats.
expr: increase(prometheus_parser_narrow_selectors_on_integers_count{job=~"prometheus-k8s|prometheus-user-workload"}[5m]) > 0
for: 15m
labels:
severity: warning
- name: openshift-kubernetes.rules
rules:
- expr: sum(rate(container_cpu_usage_seconds_total{container="",pod!=""}[5m])) BY (pod, namespace)
Expand Down
15 changes: 15 additions & 0 deletions jsonnet/rules.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ function(params) {
severity: 'warning',
},
},
{
expr: 'increase(prometheus_parser_narrow_selectors_on_integers_count{job=~"prometheus-k8s|prometheus-user-workload"}[5m]) > 0',
alert: 'NarrowSelectorsOnIntegers',
'for': '15m',
annotations: {
description: 'Queries to Prometheus {{$labels.namespace}}/{{$labels.pod}} could be too restrictive.',
summary: |||
Some queries with selectors on the values of the "le" label of classic histograms or/and the "quantile" label of summaries
may not take into account that values could also be floats.
|||,
},
labels: {
severity: 'warning',
},
},
],
},
{
Expand Down

0 comments on commit 78dc30b

Please sign in to comment.