From 11075d4517a614f06798f0596cb8f9cf20e3309f Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Thu, 22 Jan 2026 18:06:34 -0800 Subject: [PATCH] Remove logfmt parsing stage from Alloy k8s config The stage.match selector wasn't preventing Alloy from logging decode errors internally. Removing logfmt parsing entirely - JSON parsing handles most structured logs, and plain text logs still get collected. Co-Authored-By: Claude Opus 4.5 --- argocd/manifests/alloy-k8s/configmap.yaml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/argocd/manifests/alloy-k8s/configmap.yaml b/argocd/manifests/alloy-k8s/configmap.yaml index f7230af..b0e6643 100644 --- a/argocd/manifests/alloy-k8s/configmap.yaml +++ b/argocd/manifests/alloy-k8s/configmap.yaml @@ -102,32 +102,16 @@ data: } } - // Try to parse logfmt logs, but only for non-JSON lines - // This prevents noisy decode errors when JSON logs hit the logfmt parser - stage.match { - selector = "{namespace=~\".+\"} |~ \"^[^{]\"" // Lines not starting with '{' - - stage.logfmt { - mapping = { - level = "level", - ts = "ts", - caller = "caller", - component = "component", - } - } - } - - // Drop any error labels from parsing attempts (both JSON and logfmt) + // Drop JSON parsing error labels (non-JSON logs are fine, just won't have extracted fields) stage.label_drop { values = ["__error__", "__error_details__"] } - // Extract labels from parsed data (works for both JSON and logfmt) + // Extract labels from parsed JSON data stage.labels { values = { level = "", caller = "", - component = "", repository = "", } }