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

Bug 1955462: drop container_memory_failures_total metric backport #1160

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/prometheus-k8s/service-monitor-kubelet.yaml
Expand Up @@ -61,6 +61,10 @@ spec:
regex: container_(network_tcp_usage_total|network_udp_usage_total|tasks_state|cpu_load_average_10s)
sourceLabels:
- __name__
- action: drop
regex: container_memory_failures_total
sourceLabels:
- __name__
path: /metrics/cadvisor
port: https-metrics
relabelings:
Expand Down
17 changes: 16 additions & 1 deletion jsonnet/prometheus.jsonnet
Expand Up @@ -233,7 +233,22 @@ local metrics = import 'telemeter-client/metrics.jsonnet';
caFile: '/etc/prometheus/configmaps/kubelet-serving-ca-bundle/ca-bundle.crt',
insecureSkipVerify: false,
},
},
}
+
if 'path' in e && e.path == '/metrics/cadvisor' then
// Drop cAdvisor metrics with excessive cardinality.
{
metricRelabelings+: [
{
sourceLabels: ['__name__'],
action: 'drop',
regex: 'container_memory_failures_total',
},
],
}
else
{}
,
super.endpoints,
) +
// Collect metrics from CRI-O.
Expand Down