pod-logs.yaml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {{- with (.Values.metaMonitoring).grafanaAgent }}
  2. {{- if .enabled }}
  3. apiVersion: monitoring.grafana.com/v1alpha1
  4. kind: PodLogs
  5. metadata:
  6. name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "meta-monitoring") }}
  7. namespace: {{ .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. pipelineStages:
  19. - cri: { }
  20. relabelings:
  21. - action: replace # For consistency with metrics
  22. replacement: $1
  23. separator: /
  24. sourceLabels:
  25. - __meta_kubernetes_namespace
  26. - __meta_kubernetes_pod_container_name
  27. targetLabel: job
  28. - action: replace # Necessary for slow queries dashboard
  29. sourceLabels:
  30. - __meta_kubernetes_pod_container_name
  31. targetLabel: name
  32. - targetLabel: cluster
  33. replacement: {{ include "tempo.clusterName" $ }}
  34. namespaceSelector:
  35. matchNames:
  36. - {{ $.Release.Namespace | quote }}
  37. selector:
  38. matchLabels:
  39. # Scrape logs from all components
  40. {{- include "tempo.selectorLabels" (dict "ctx" $) | nindent 6 }}
  41. {{- end -}}
  42. {{- end -}}