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