Log filtering cleanup and observability improvements #45
1 changed files with 6 additions and 0 deletions
Silence logfmt parse errors for non-logfmt logs
The logfmt stage tries to parse all logs, including JSON. When it fails, it adds __error__ labels. Drop these labels since the logs are still processed correctly (JSON parser already extracted fields). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
commit
848fea9e1f
|
|
@ -103,6 +103,7 @@ data:
|
|||
}
|
||||
|
||||
// Try to parse logfmt logs (e.g., Loki, Prometheus, Go services)
|
||||
// Silently skip lines that aren't valid logfmt
|
||||
stage.logfmt {
|
||||
mapping = {
|
||||
level = "level",
|
||||
|
|
@ -112,6 +113,11 @@ data:
|
|||
}
|
||||
}
|
||||
|
||||
// Drop the logfmt error label if parsing failed (prevents noisy errors)
|
||||
stage.label_drop {
|
||||
values = ["__error__", "__error_details__"]
|
||||
}
|
||||
|
||||
// Extract labels from parsed data (works for both JSON and logfmt)
|
||||
stage.labels {
|
||||
values = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue