Skip to content

Commit

Permalink
Propage kminion pod custom labels as metrics labels
Browse files Browse the repository at this point in the history
When defined, the pod customLabels are propagates
to service monitor as podTargetLabels.
See https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#servicemonitorspec
  • Loading branch information
amuraru committed Oct 23, 2021
1 parent 8a393eb commit d3016f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/kminion/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ spec:
targetLabels:
{{- toYaml .Values.serviceMonitor.targetLabels | nindent 4}}
{{- end}}
{{- if .Values.customLabels }}
podTargetLabels:
{{- (keys .Values.customLabels | sortAlpha) | toYaml | nindent 4 }}
{{- end}}
{{- end }}

0 comments on commit d3016f8

Please sign in to comment.