diff --git a/jsonnet/custom-prometheus.jsonnet b/jsonnet/custom-prometheus.jsonnet index 99b6caca00..9c733766ba 100644 --- a/jsonnet/custom-prometheus.jsonnet +++ b/jsonnet/custom-prometheus.jsonnet @@ -27,13 +27,21 @@ prometheus+:: { serviceMonitorKubelet+: { spec+: { - metricRelabelings+: [ - { - action: 'replace', - sourceLabels: ['node'], - targetLabel: 'instance', - }, - ], + endpoints: std.map(function(endpoint) + if endpoint.port == "https-metrics" then + endpoint { + metricRelabelings+: [ + { + action: 'replace', + sourceLabels: ['node'], + targetLabel: 'instance', + }, + ], + } + else + endpoint, + super.endpoints + ), }, }, },