Files
devops-infra-helm-charts-gcp/helm-templates/opentelemetry-collector-latest/templates/servicemonitor.yaml
T
2026-08-26 03:39:42 +05:30

28 lines
1.1 KiB
YAML

{{- if and (eq (include "opentelemetry-collector.serviceEnabled" .) "true") .Values.serviceMonitor.enabled .Values.serviceMonitor.metricsEndpoints }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "opentelemetry-collector.fullname" . }}
namespace: {{ template "opentelemetry-collector.namespace" . }}
labels:
{{- include "opentelemetry-collector.labels" . | nindent 4 }}
{{- range $key, $value := .Values.serviceMonitor.extraLabels }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "opentelemetry-collector.selectorLabels" . | nindent 6 }}
{{- include "opentelemetry-collector.component" . | nindent 6 }}
endpoints:
{{- toYaml .Values.serviceMonitor.metricsEndpoints | nindent 4 }}
{{- with .Values.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}