Is your feature request related to a problem ?
Yes
The additionalMetricsRelabels field in the prometheus-json-exporter ServiceMonitor template currently only supports simple key-value string replacements. This limits its capability compared to the full Prometheus relabeling specification.
See: here
Current Implementation
The current template hardcodes simple replacements:
{{- range $targetLabel, $replacement := .additionalMetricsRelabels | default $.Values.serviceMonitor.defaults.additionalMetricsRelabels }}
- targetLabel: {{ $targetLabel }}
replacement: {{ $replacement }}
action: replace
{{- end }}
This only allows simple label replacement:
additionalMetricsRelabels:
label1: "value1"
label2: "value2"
Expected Behaviour
The template should support the full Prometheus relabeling spec, allowing users to define:
additionalMetricsRelabels:
- sourceLabels: [some_label]
regex: '(.+)\.(.+)'
replacement: '${1}-${2}'
targetLabel: custom_label
action: replace
Describe the solution you'd like.
Update the template to iterate over a list of relabeling configurations instead of a map:
...
metricRelabelings:
...
{{- with .additionalMetricsRelabels | default $.Values.serviceMonitor.defaults.additionalMetricsRelabels }}
{{- toYaml . | nindent 6 }}
{{- end }}
Describe alternatives you've considered.
N/A
Additional context.
No response
Is your feature request related to a problem ?
Yes
The additionalMetricsRelabels field in the prometheus-json-exporter ServiceMonitor template currently only supports simple key-value string replacements. This limits its capability compared to the full Prometheus relabeling specification.
See: here
Current Implementation
The current template hardcodes simple replacements:
This only allows simple label replacement:
Expected Behaviour
The template should support the full Prometheus relabeling spec, allowing users to define:
Describe the solution you'd like.
Update the template to iterate over a list of relabeling configurations instead of a map:
... metricRelabelings: ... {{- with .additionalMetricsRelabels | default $.Values.serviceMonitor.defaults.additionalMetricsRelabels }} {{- toYaml . | nindent 6 }} {{- end }}Describe alternatives you've considered.
N/A
Additional context.
No response