Commit d8cffef0 by Frank Mai Committed by Denise

Fixed duplicate measure

**Problem:** Duplicate measure in `container_*` metrics when scraping >=v1.16 kubelet endpoint in TLS: the bottom `metricRelabelings` would replace the top one. **Solution:** Merge both two `metricRelabelings` in TLS scraping, and fix wrong `labeldrop` when scraping in non-TLS.
parent 257371cd
......@@ -55,9 +55,6 @@ spec:
{{- if .Values.insecureSkipVerify }}
insecureSkipVerify: true
{{- end }}
metricRelabelings:
- action: labeldrop
regex: (^id$|^image$|^name$|^cpu$)
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
......@@ -71,8 +68,10 @@ spec:
action: replace
regex: (.+)
replacement: $1
{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
metricRelabelings:
- action: labeldrop
regex: (^id$|^image$|^name$|^cpu$)
{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
- action: replace
regex: (.+)
replacement: $1
......@@ -111,9 +110,6 @@ spec:
targetLabel: pod_name
{{- else }}
- port: http-metrics
metricRelabelings:
- action: labeldrop
regex: (^id$|^image$|^name$|^cpu$)
relabelings:
- sourceLabels:
- __meta_kubernetes_pod_host_ip
......@@ -143,8 +139,10 @@ spec:
action: replace
regex: (.+)
replacement: $1
{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
metricRelabelings:
- action: labeldrop
regex: (^id$|^image$|^name$|^cpu$)
{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
- action: replace
regex: (.+)
replacement: $1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment