Skip to content

Commit

Permalink
Allow for the pod logs annotation to actually be configurable (#739)
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall authored Sep 18, 2024
1 parent b86647e commit 2ad3313
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ discovery.relabel "pod_logs" {
discovery.relabel "filtered_pod_logs" {
targets = discovery.relabel.pod_logs.output
rule { // Drop anything with a "falsy" annotation value
source_labels = ["__meta_kubernetes_pod_annotation_k8s_grafana_com_logs_autogather"]
source_labels = ["__meta_kubernetes_pod_annotation_{{ include "escape_label" .Values.logs.pod_logs.annotation }}"]
regex = "(false|no|skip)"
action = "drop"
}
{{- if eq .Values.logs.pod_logs.discovery "annotation" }}
rule { // If discovering via annotation, then only keep pods with annotation values
source_labels = ["__meta_kubernetes_pod_annotation_k8s_grafana_com_logs_autogather"]
source_labels = ["__meta_kubernetes_pod_annotation_{{ include "escape_label" .Values.logs.pod_logs.annotation }}"]
regex = ".+"
action = "keep"
}
Expand Down

0 comments on commit 2ad3313

Please sign in to comment.