argocd-helm/charts/argo-workflows/templates/controller/workflow-controller-servicemonitor.yaml
Stefan Tertan 00e585342a
feat(argo-workflows): add Prometheus ServiceMonitor relabelings, metricRelabelings & targetLabels (#1977)
* feat(argo-workflows): add Prometheus ServiceMonitor relabelings, metricRelabelings & targetLabels

Signed-off-by: Stefan Tertan <stefan.tertan@fundingcircle.com>

* chore(argo-workflows): bump Helm chart patch version

Signed-off-by: Stefan Tertan <stefan.tertan@fundingcircle.com>

* docs(argo-workflows): update README.md via `helm-docs`

Signed-off-by: Stefan Tertan <stefan.tertan@fundingcircle.com>

* chore(argo-workflows): update changelog via chart annotation

Signed-off-by: Stefan Tertan <stefan.tertan@fundingcircle.com>

* chore(argo-workflows): remove URLs from README

Signed-off-by: Stefan Tertan <stefan.tertan@fundingcircle.com>

---------

Signed-off-by: Stefan Tertan <stefan.tertan@fundingcircle.com>
Co-authored-by: Aikawa <yu.croco@gmail.com>
2023-04-24 11:57:36 -05:00

50 lines
1.9 KiB
YAML

{{- if and (or .Values.controller.metricsConfig.enabled .Values.controller.telemetryConfig.enabled) .Values.controller.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "argo-workflows.controller.fullname" . }}
namespace: {{ default .Release.Namespace .Values.controller.serviceMonitor.namespace | quote }}
labels:
{{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- with .Values.controller.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
{{- if .Values.controller.metricsConfig.enabled }}
- port: metrics
path: {{ .Values.controller.metricsConfig.path }}
interval: 30s
{{- with .Values.controller.metricsConfig.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.metricsConfig.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.controller.telemetryConfig.enabled }}
- port: telemetry
path: {{ .Values.controller.telemetryConfig.path }}
interval: 30s
{{- with .Values.controller.metricsConfig.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.metricsConfig.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.controller.metricsConfig.targetLabels }}
targetLabels:
{{- toYaml . | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
selector:
matchLabels:
{{- include "argo-workflows.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }}
{{- end }}