feat(helm): add serviceMonitor.additionalLabels#90
Open
adam820 wants to merge 1 commit into
Open
Conversation
Lets the ServiceMonitor carry extra metadata labels. Needed where a Prometheus discovers ServiceMonitors via a serviceMonitorSelector (e.g. kube-prometheus-stack's default match on `release: <release-name>`), which the chart previously couldn't satisfy.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Helm chart value to let users attach extra metadata labels to the generated Prometheus ServiceMonitor, enabling compatibility with setups where Prometheus discovers ServiceMonitors via a label selector (e.g. kube-prometheus-stack’s serviceMonitorSelector).
Changes:
- Add
serviceMonitor.additionalLabelsto the chart values. - Render
serviceMonitor.additionalLabelsintoServiceMonitor.metadata.labels.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| helm/klag-exporter/values.yaml | Introduces serviceMonitor.additionalLabels value (with inline documentation). |
| helm/klag-exporter/templates/servicemonitor.yaml | Applies additional labels to the ServiceMonitor’s metadata labels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
6
to
+10
| labels: | ||
| {{- include "klag-exporter.labels" . | nindent 4 }} | ||
| {{- with .Values.serviceMonitor.additionalLabels }} | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} |
Comment on lines
+238
to
+239
| # Additional labels for the serviceMonitor metadata | ||
| additionalLabels: {} |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Lets the ServiceMonitor carry extra metadata labels. Needed where a Prometheus discovers ServiceMonitors via a serviceMonitorSelector (e.g. kube-prometheus-stack's default match on
release: <release-name>), which the chart previously couldn't satisfy.