Fix 1Password Connect numeric log levels misclassified in Grafana #287
3 changed files with 25 additions and 0 deletions
|
|
@ -100,6 +100,18 @@ loki.process "pods" {
|
|||
values = ["__error__", "__error_details__"]
|
||||
}
|
||||
|
||||
// Normalize 1password-connect numeric log levels to strings (1=error..5=trace)
|
||||
// Scoped to the 1password namespace so other services are unaffected.
|
||||
// See: https://github.com/1Password/connect/issues/44
|
||||
stage.match {
|
||||
selector = "{namespace=\"1password\"}"
|
||||
|
||||
stage.template {
|
||||
source = "level"
|
||||
template = "{{ if eq .Value \"1\" }}error{{ else if eq .Value \"2\" }}warn{{ else if eq .Value \"3\" }}info{{ else if eq .Value \"4\" }}debug{{ else if eq .Value \"5\" }}trace{{ else }}{{ .Value }}{{ end }}"
|
||||
}
|
||||
}
|
||||
|
||||
// Extract labels from parsed JSON data
|
||||
stage.labels {
|
||||
values = {
|
||||
|
|
|
|||
|
|
@ -139,6 +139,18 @@ loki.process "pods" {
|
|||
values = ["__error__", "__error_details__"]
|
||||
}
|
||||
|
||||
// Normalize 1password-connect numeric log levels to strings (1=error..5=trace)
|
||||
// Scoped to the 1password namespace so other services are unaffected.
|
||||
// See: https://github.com/1Password/connect/issues/44
|
||||
stage.match {
|
||||
selector = "{namespace=\"1password\"}"
|
||||
|
||||
stage.template {
|
||||
source = "level"
|
||||
template = "{{ if eq .Value \"1\" }}error{{ else if eq .Value \"2\" }}warn{{ else if eq .Value \"3\" }}info{{ else if eq .Value \"4\" }}debug{{ else if eq .Value \"5\" }}trace{{ else }}{{ .Value }}{{ end }}"
|
||||
}
|
||||
}
|
||||
|
||||
// Extract labels from parsed JSON data
|
||||
stage.labels {
|
||||
values = {
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Fix 1Password Connect logs showing as errors in Grafana by normalizing numeric log levels (1-5) to standard strings (error/warn/info/debug/trace) in the Alloy log processing pipeline.
|
||||
Loading…
Add table
Add a link
Reference in a new issue