TT-12004 Need an option to add metricrelabling in podmonitor
utkarsh079 opened this issue · 1 comments
utkarsh079 commented
In current helm chart, there is no option to add metric relabling. Since the podmonitor is deployed by chart, user does not have an easy option to do any kind of relabling of metrics
Use case: we need to relable 'time_stamp' to 'timestamp'
Example:
{{ if has "prometheus" .Values.pump.backend }}
{{ if .Values.pump.prometheusPump.prometheusOperator.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: tyk-pump-podmonitor-{{ include "tyk-pump.fullname" . }}
labels:
{{- range $key, $value := .Values.pump.prometheusPump.prometheusOperator.podMonitorSelector }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
selector:
matchLabels:
app: pump-{{ include "tyk-pump.fullname" . }}
podMetricsEndpoints:
- port: tyk-pump-port
{{- if .Values.prometheusPump.podMonitorSelector.metricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.prometheusPump.podMonitorSelector.metricRelabelings | indent 4) . }}
{{- end }}
{{ end }}
{{ end }}
caroltyk commented
Thank you for raising this @utkarsh079 . We have added the request to our backlog for prioritisation. If you would like to submit a PR for this, we are happy to provide guidance.