From 3da15db575ae31e62ddfafd269e11edde2347461 Mon Sep 17 00:00:00 2001 From: rohow Date: Mon, 14 Apr 2025 10:13:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(loki):=20loki=E6=97=A5=E5=BF=97=E6=90=9C?= =?UTF-8?q?=E9=9B=86=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/infra/monitor/loki/helmchart-promtail.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/infra/monitor/loki/helmchart-promtail.yaml b/apps/infra/monitor/loki/helmchart-promtail.yaml index b73fc26..c926bb8 100644 --- a/apps/infra/monitor/loki/helmchart-promtail.yaml +++ b/apps/infra/monitor/loki/helmchart-promtail.yaml @@ -19,6 +19,11 @@ spec: tenant_id: 1 snippets: extraRelabelConfigs: + # 匹配log_collecting_enabled标签 只有为true时才收集日志 - source_labels: [__meta_kubernetes_pod_label_log_collecting_enabled] action: keep regex: true + # 匹配log_collecting_only_errors标签并只保留stderr流 + - source_labels: [__meta_kubernetes_pod_label_log_collecting_only_errors] + action: keep + regex: stderr