-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[kube-prometheus-stack] add serviceMonitor.additionalEndpoints #3515
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4462844
add serviceMonitor.additionalEndpoints
TheRealNoob 2083c54
[prometheus-json-exporter] defaults and service labels/annotations su…
bentonam 5e02c58
fix closing if statements
TheRealNoob 55d8922
add newlines
TheRealNoob 64f86f7
fix root reference
TheRealNoob dab3fe0
[kube-prometheus-stack] Fix IO panels in Cluster Overview (#3902)
jkroepke a4ad279
[kube-prometheus-stack] fix range function in servicemonitors (#3888)
r3kzi 6373b54
[prometheus-smartctl-exporter] Add relabelings to servicemonitor (#3891)
nepomucen f85dc96
bump chart version
TheRealNoob ca7bb08
Merge branch 'main' into main
TheRealNoob File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,17 +36,15 @@ spec: | |
bearerTokenFile: {{ .Values.alertmanager.serviceMonitor.bearerTokenFile }} | ||
{{- end }} | ||
{{- if .Values.alertmanager.serviceMonitor.tlsConfig }} | ||
tlsConfig: {{ toYaml .Values.alertmanager.serviceMonitor.tlsConfig | nindent 6 }} | ||
tlsConfig: {{- toYaml .Values.alertmanager.serviceMonitor.tlsConfig | nindent 6 }} | ||
{{- end }} | ||
path: "{{ trimSuffix "/" .Values.alertmanager.alertmanagerSpec.routePrefix }}/metrics" | ||
{{- if .Values.alertmanager.serviceMonitor.metricRelabelings }} | ||
metricRelabelings: | ||
{{ tpl (toYaml .Values.alertmanager.serviceMonitor.metricRelabelings | indent 6) . }} | ||
{{- end }} | ||
{{- if .Values.alertmanager.serviceMonitor.relabelings }} | ||
relabelings: | ||
{{ toYaml .Values.alertmanager.serviceMonitor.relabelings | indent 6 }} | ||
{{- end }} | ||
{{- if .Values.alertmanager.serviceMonitor.metricRelabelings }} | ||
metricRelabelings: {{- tpl (toYaml .Values.alertmanager.serviceMonitor.metricRelabelings | nindent 6) . }} | ||
{{- end }} | ||
{{- if .Values.alertmanager.serviceMonitor.relabelings }} | ||
relabelings: {{- toYaml .Values.alertmanager.serviceMonitor.relabelings | nindent 6 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark |
||
{{- end }} | ||
- port: reloader-web | ||
{{- if .Values.alertmanager.serviceMonitor.interval }} | ||
interval: {{ .Values.alertmanager.serviceMonitor.interval }} | ||
|
@@ -61,15 +59,38 @@ spec: | |
bearerTokenFile: {{ .Values.alertmanager.serviceMonitor.bearerTokenFile }} | ||
{{- end }} | ||
{{- if .Values.alertmanager.serviceMonitor.tlsConfig }} | ||
tlsConfig: {{ toYaml .Values.alertmanager.serviceMonitor.tlsConfig | nindent 6 }} | ||
tlsConfig: {{- toYaml .Values.alertmanager.serviceMonitor.tlsConfig | nindent 6 }} | ||
{{- end }} | ||
path: "/metrics" | ||
{{- if .Values.alertmanager.serviceMonitor.metricRelabelings }} | ||
metricRelabelings: | ||
{{ tpl (toYaml .Values.alertmanager.serviceMonitor.metricRelabelings | indent 6) . }} | ||
{{- end }} | ||
{{- if .Values.alertmanager.serviceMonitor.relabelings }} | ||
relabelings: | ||
{{ toYaml .Values.alertmanager.serviceMonitor.relabelings | indent 6 }} | ||
{{- end }} | ||
{{- if .Values.alertmanager.serviceMonitor.metricRelabelings }} | ||
metricRelabelings: {{- tpl (toYaml .Values.alertmanager.serviceMonitor.metricRelabelings | nindent 6) . }} | ||
{{- end }} | ||
{{- if .Values.alertmanager.serviceMonitor.relabelings }} | ||
relabelings: {{- toYaml .Values.alertmanager.serviceMonitor.relabelings | nindent 6 }} | ||
{{- end }} | ||
{{- range .Values.alertmanager.serviceMonitor.additionalEndpoints }} | ||
- port: {{ .port }} | ||
{{- if or $.Values.alertmanager.serviceMonitor.interval .interval }} | ||
interval: {{ default $.Values.alertmanager.serviceMonitor.interval .interval }} | ||
{{- end }} | ||
{{- if or $.Values.alertmanager.serviceMonitor.proxyUrl .proxyUrl }} | ||
proxyUrl: {{ default $.Values.alertmanager.serviceMonitor.proxyUrl .proxyUrl }} | ||
{{- end }} | ||
{{- if or $.Values.alertmanager.serviceMonitor.scheme .scheme }} | ||
scheme: {{ default $.Values.alertmanager.serviceMonitor.scheme .scheme }} | ||
{{- end }} | ||
{{- if or $.Values.alertmanager.serviceMonitor.bearerTokenFile .bearerTokenFile }} | ||
bearerTokenFile: {{ default $.Values.alertmanager.serviceMonitor.bearerTokenFile .bearerTokenFile }} | ||
{{- end }} | ||
{{- if or $.Values.alertmanager.serviceMonitor.tlsConfig .tlsConfig }} | ||
tlsConfig: {{- default $.Values.alertmanager.serviceMonitor.tlsConfig .tlsConfig | toYaml | nindent 6 }} | ||
{{- end }} | ||
path: {{ .path }} | ||
{{- if or $.Values.alertmanager.serviceMonitor.metricRelabelings .metricRelabelings }} | ||
metricRelabelings: {{- tpl (default $.Values.alertmanager.serviceMonitor.metricRelabelings .metricRelabelings | toYaml | nindent 6) . }} | ||
{{- end }} | ||
{{- if or $.Values.alertmanager.serviceMonitor.relabelings .relabelings }} | ||
relabelings: {{- default $.Values.alertmanager.serviceMonitor.relabelings .relabelings | toYaml | nindent 6 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would this even require nindent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My purpose in changing this was just to make the code more readable. The outcome should be identical. I've just run a
helm template
on my branch as well the main branch (with a values file that defines both relabelings and metricsRelabelings) and and the outcomes are the identical.The documentation confirms both are expected to be a
[]RelabelConfig
list, so nindent sounds right to me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you feel it doesn't make it more readable I'd be happy to change it back. Looking at the code on Github's website I'd say it doesn't feel any different but when looking on an IDE, each Endpoint is now equally indented so you can now tell where they start and stop.