Skip to content

Commit 374413f

Browse files
authored
Merge pull request #1409 from dgrisonnet/drop-pa-metrics
Drop some of the metrics exposed by prometheus-adapter
2 parents d7446e6 + 5ebbb65 commit 374413f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

jsonnet/kube-prometheus/components/prometheus-adapter.libsonnet

+15
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,21 @@ function(params) {
172172
insecureSkipVerify: true,
173173
},
174174
bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',
175+
metricRelabelings: [
176+
{
177+
sourceLabels: ['__name__'],
178+
action: 'drop',
179+
regex: '(' + std.join('|',
180+
[
181+
'apiserver_client_certificate_.*', // The only client supposed to connect to the aggregated API is the apiserver so it is not really meaningful to monitor its certificate.
182+
'apiserver_envelope_.*', // Prometheus-adapter isn't using envelope for storage.
183+
'apiserver_flowcontrol_.*', // Prometheus-adapter isn't using flowcontrol.
184+
'apiserver_storage_.*', // Prometheus-adapter isn't using the apiserver storage.
185+
'apiserver_webhooks_.*', // Prometeus-adapter doesn't make use of apiserver webhooks.
186+
'workqueue_.*', // Metrics related to the internal apiserver auth workqueues are not very useful to prometheus-adapter.
187+
]) + ')',
188+
},
189+
],
175190
},
176191
],
177192
},

manifests/prometheus-adapter-serviceMonitor.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ spec:
1212
endpoints:
1313
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
1414
interval: 30s
15+
metricRelabelings:
16+
- action: drop
17+
regex: (apiserver_client_certificate_.*|apiserver_envelope_.*|apiserver_flowcontrol_.*|apiserver_storage_.*|apiserver_webhooks_.*|workqueue_.*)
18+
sourceLabels:
19+
- __name__
1520
port: https
1621
scheme: https
1722
tlsConfig:

0 commit comments

Comments
 (0)