Add relabel_config to replace endpoint address

This commit adds a relabeling config to the scrape config of
windows-exporter using the 'replace' action field to replace
the node endpoint address with node name. The windows_exporter
returns endpoint target as node IP but we need it to be node name
to use the prometheus adapter queries and collect resource metrics
information.
This commit is contained in:
mansikulkarni96 2021-03-31 13:21:01 -04:00
parent 7ba0479433
commit 1c63b6d021

View File

@ -10,6 +10,17 @@ local windowsrules = import 'kubernetes-mixin/rules/windows.libsonnet';
targets: [error 'must provide targets array'],
},
],
relabel_configs: [
{
action: 'replace',
regex: '(.*)',
replacement: '$1',
sourceLabels: [
'__meta_kubernetes_endpoint_address_target_name',
],
targetLabel: 'instance',
},
],
},
grafana+:: {