servicemonitor.yaml 846 B

12345678910111213141516171819
  1. {{- if and .Values.serviceMonitor.enabled .Values.serviceMonitor.metricsEndpoints (or (eq .Values.mode "deployment") (eq .Values.mode "statefulset")) }}
  2. apiVersion: monitoring.coreos.com/v1
  3. kind: ServiceMonitor
  4. metadata:
  5. name: {{ include "opentelemetry-collector.fullname" . }}
  6. namespace: {{ template "opentelemetry-collector.namespace" . }}
  7. labels:
  8. {{- include "opentelemetry-collector.labels" . | nindent 4 }}
  9. {{- range $key, $value := .Values.serviceMonitor.extraLabels }}
  10. {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
  11. {{- end }}
  12. spec:
  13. selector:
  14. matchLabels:
  15. {{- include "opentelemetry-collector.selectorLabels" . | nindent 6 }}
  16. {{- include "opentelemetry-collector.component" . | nindent 6 }}
  17. endpoints:
  18. {{- toYaml .Values.serviceMonitor.metricsEndpoints | nindent 2 }}
  19. {{- end }}