Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TT-12004 Need an option to add metricrelabling in podmonitor #226

Open
utkarsh079 opened this issue Feb 8, 2024 · 1 comment
Open

TT-12004 Need an option to add metricrelabling in podmonitor #226

utkarsh079 opened this issue Feb 8, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@utkarsh079
Copy link

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 caroltyk added the enhancement New feature or request label Apr 26, 2024
@caroltyk caroltyk changed the title Need an option to add metricrelabling in podmonitor TT-12004 Need an option to add metricrelabling in podmonitor Apr 26, 2024
@caroltyk
Copy link
Collaborator

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.

@caroltyk caroltyk added the good first issue Good for newcomers label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants