metrics-instance.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. {{- with .Values.metaMonitoring.grafanaAgent }}
  2. {{- if .enabled }}
  3. apiVersion: monitoring.grafana.com/v1alpha1
  4. kind: MetricsInstance
  5. metadata:
  6. name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "meta-monitoring") }}
  7. namespace: {{ $.Values.metaMonitoring.grafanaAgent.namespace | default $.Release.Namespace | quote }}
  8. labels:
  9. {{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }}
  10. {{- with .labels }}
  11. {{- toYaml . | nindent 4 }}
  12. {{- end }}
  13. {{- with .annotations }}
  14. annotations:
  15. {{- toYaml . | nindent 4 }}
  16. {{- end }}
  17. spec:
  18. remoteWrite:
  19. {{- if or (.metrics).additionalRemoteWriteConfigs (.metrics).remote }}
  20. {{- range $i, $cfg := prepend ((.metrics).additionalRemoteWriteConfigs | default list) (.metrics).remote }}
  21. {{- with $cfg }}
  22. {{- if $cfg.url }}
  23. - {{- include "tempo.metaMonitoring.metrics.remoteWrite" (dict "ctx" $ "url" .url "auth" .auth "usernameKey" (printf "username-%d" $i) "headers" .headers ) | nindent 6 -}}
  24. {{- end }}
  25. {{- end }}
  26. {{- end }}
  27. {{- end }}
  28. # Supply an empty namespace selector to look in all namespaces. Remove
  29. # this to only look in the same namespace as the MetricsInstance CR
  30. serviceMonitorNamespaceSelector: {}
  31. serviceMonitorSelector:
  32. # Scrape ServiceMonitors from all components
  33. matchLabels:
  34. {{- include "tempo.selectorLabels" (dict "ctx" $) | nindent 6 }}
  35. {{- end }}
  36. {{- end }}