Files
devops-infra-helm-charts-gcp/helm-templates/mimir-distributed/templates/metamonitoring/pod-logs.yaml
T
2026-08-26 03:39:42 +05:30

47 lines
1.4 KiB
YAML

{{- with (.Values.metaMonitoring).grafanaAgent }}
{{- if and .enabled .logs.enabled }}
apiVersion: monitoring.grafana.com/v1alpha1
kind: PodLogs
metadata:
name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "meta-monitoring") }}
namespace: {{ .namespace | default $.Release.Namespace | quote }}
labels:
{{- include "mimir.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
{{- if kindIs "string" .logs.clusterLabel }}
- targetLabel: cluster
replacement: "{{ .logs.clusterLabel | default (include "mimir.clusterName" $) }}"
{{- end }}
namespaceSelector:
matchNames:
- {{ $.Release.Namespace | quote }}
selector:
matchLabels:
# Scrape logs from all components
{{- include "mimir.selectorLabels" (dict "ctx" $) | nindent 6 }}
{{- end -}}
{{- end -}}