pod-logs.yaml 1.28 KB
Newer Older
Vũ Hoàng Nam's avatar
Vũ Hoàng Nam committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
{{- with (.Values.metaMonitoring).grafanaAgent }}
{{- if .enabled }}
apiVersion: monitoring.grafana.com/v1alpha1
kind: PodLogs
metadata:
  name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "meta-monitoring") }}
  namespace: {{ .namespace | default $.Release.Namespace | quote }}
  labels:
    {{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }}
    {{- with .labels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- with .annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  pipelineStages:
    - cri: { }
  relabelings:
    - action: replace # For consistency with metrics
      replacement: $1
      separator: /
      sourceLabels:
        - __meta_kubernetes_namespace
        - __meta_kubernetes_pod_container_name
      targetLabel: job
    - action: replace # Necessary for slow queries dashboard
      sourceLabels:
        - __meta_kubernetes_pod_container_name
      targetLabel: name
    - targetLabel: cluster
      replacement: {{ include "tempo.clusterName" $ }}

  namespaceSelector:
    matchNames:
      - {{ $.Release.Namespace | quote }}

  selector:
    matchLabels:
      # Scrape logs from all components
      {{- include "tempo.selectorLabels" (dict "ctx" $) | nindent 6 }}

{{- end -}}
{{- end -}}