servicemonitor.yaml 780 B

123456789101112131415161718
  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. labels:
  7. {{- include "opentelemetry-collector.labels" . | nindent 4 }}
  8. {{- range $key, $value := .Values.serviceMonitor.extraLabels }}
  9. {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
  10. {{- end }}
  11. spec:
  12. selector:
  13. matchLabels:
  14. {{- include "opentelemetry-collector.selectorLabels" . | nindent 6 }}
  15. {{- include "opentelemetry-collector.component" . | nindent 6 }}
  16. endpoints:
  17. {{- toYaml .Values.serviceMonitor.metricsEndpoints | nindent 2 }}
  18. {{- end }}