Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: set up the PrometheusPossibleNarrowSelectors alert #2554

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 {{$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.
expr: max(prometheus_narrow_selectors_count{job=~"prometheus-k8s|prometheus-user-workload|thanos-querier|thanos-ruler"}) by (namespace, job, pod) > 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',
},
},
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add runbooks

expr: 'max(prometheus_narrow_selectors_count{job=~"prometheus-k8s|prometheus-user-workload|thanos-querier|thanos-ruler"}) by (namespace, job, pod) > 0',
alert: 'PrometheusPossibleNarrowSelectors',
'for': '15m',
annotations: {
description: 'Queries or/and relabel configs on Prometheus {{$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.
|||,
},
labels: {
severity: 'warning',
},
},
],
},
{
Expand Down
2 changes: 2 additions & 0 deletions pkg/manifests/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,8 @@ func (f *Factory) PrometheusK8s(grpcTLS *v1.Secret, telemetrySecret *v1.Secret)
if f.config.ClusterMonitoringConfiguration.PrometheusK8sConfig.LogLevel != "" {
p.Spec.LogLevel = f.config.ClusterMonitoringConfiguration.PrometheusK8sConfig.LogLevel
}
// Temp, debugging only
p.Spec.LogLevel = "debug"
machine424 marked this conversation as resolved.
Show resolved Hide resolved

if f.config.ClusterMonitoringConfiguration.PrometheusK8sConfig.Retention != "" {
p.Spec.Retention = monv1.Duration(f.config.ClusterMonitoringConfiguration.PrometheusK8sConfig.Retention)
Expand Down