Add metrics_path label to kubelet servicemonitor endpoints (#277)

* Add metrics_path label to kubelet servicemonitor endpoints

* Set kubelet metric_path label in jsonnet

* Add generated kubelet servicemonitor
This commit is contained in:
Jake Utley
2019-10-24 00:16:57 -07:00
committed by Frederic Branczyk
parent a7884a6c18
commit 4e5b454ba8
5 changed files with 82 additions and 4 deletions

View File

@@ -281,6 +281,12 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
insecureSkipVerify: true,
},
bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',
relabelings: [
{
sourceLabels: ['__metrics_path__'],
targetLabel: 'metrics_path'
},
],
},
{
port: 'https-metrics',
@@ -292,6 +298,12 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
insecureSkipVerify: true,
},
bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',
relabelings: [
{
sourceLabels: ['__metrics_path__'],
targetLabel: 'metrics_path'
},
],
metricRelabelings: [
// Drop a bunch of metrics which are disabled but still sent, see
// https://github.com/google/cadvisor/issues/1925.