Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prometheus-kube-stack] Fix relabeling and metricRelabeling for additional serviceMonitor #5133

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 67.9.0
version: 67.10.0
appVersion: v0.79.2
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ items:
{{- if .jobLabel }}
jobLabel: {{ .jobLabel }}
{{- end }}
{{- if .metricRelabelings }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for another review here. But I take note here this result into a invalid YAML, if jobLabel is defined above.

Also it may leads into unexpected results, if endpoints contains multiple endpoint items.

Since the relabelings config can be part of the endpoints config as well. I think removing the 2 options would be the best possible option here.

metricRelabelings:
{{- toYaml .metricRelabelings | nindent 12 }}
{{- end }}
{{- if .relabelings }}
relabelings:
{{- toYaml .relabelings | nindent 12 }}
{{- end }}

{{- if .namespaceSelector }}
namespaceSelector:
{{ toYaml .namespaceSelector | indent 8 }}
Expand All @@ -34,14 +43,6 @@ items:
{{- if .podTargetLabels }}
podTargetLabels:
{{ toYaml .podTargetLabels | indent 8 }}
{{- end }}
{{- if .metricRelabelings }}
metricRelabelings:
{{ toYaml .metricRelabelings | indent 8 }}
{{- end }}
{{- if .relabelings }}
relabelings:
{{ toYaml .relabelings | indent 8 }}
{{- end }}
{{- if .fallbackScrapeProtocol }}
fallbackScrapeProtocol: {{ .fallbackScrapeProtocol }}
Expand Down
Loading