Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: PrometheusPossibleNarrowSelectors
annotations:
description: Queries or/and relabel configs on Prometheus/Thanos {{$labels.namespace}}/{{$labels.pod}} could be too restrictive.
summary: |
Some queries or/and relabel configs 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, they may need to be adjusted. If assistance is needed, please let us know at https://issues.redhat.com/browse/MON-4129.
expr: increase(prometheus_narrow_selectors_count{job=~"prometheus-k8s|prometheus-user-workload|thanos-querier|thanos-ruler"}[5m]) > 0
Copy link
Contributor

@juzhao juzhao Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is metrics prometheus_narrow_selectors_count since prometheus 3? did not find in prometheus 2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, It'll be added downstream on top of v3 openshift/prometheus@3e1c833 and on thanos openshift/thanos#158

We'll decide later if we want to release it, but in the meantime, it should continue helping to identify misuses during dev.

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_narrow_selectors_count{job=~"prometheus-k8s|prometheus-user-workload|thanos-querier|thanos-ruler"}[5m]) > 0',
alert: 'PrometheusPossibleNarrowSelectors',
'for': '15m',
annotations: {
description: 'Queries or/and relabel configs on Prometheus/Thanos {{$labels.namespace}}/{{$labels.pod}} could be too restrictive.',
summary: |||
Some queries or/and relabel configs 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, they may need to be adjusted. If assistance is needed, please let us know at https://issues.redhat.com/browse/MON-4129.
|||,
},
labels: {
severity: 'warning',
},
},
],
},
{
Expand Down