Skip to content

feat(helm): add serviceMonitor.additionalLabels#90

Open
adam820 wants to merge 1 commit into
softwaremill:mainfrom
adam820:feat/servicemonitor-additional-labels
Open

feat(helm): add serviceMonitor.additionalLabels#90
adam820 wants to merge 1 commit into
softwaremill:mainfrom
adam820:feat/servicemonitor-additional-labels

Conversation

@adam820

@adam820 adam820 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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.

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.
Copilot AI review requested due to automatic review settings June 29, 2026 21:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.additionalLabels to the chart values.
  • Render serviceMonitor.additionalLabels into ServiceMonitor.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: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants