mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
fix: level and severity text consistency issue (#67)
This commit is contained in:
parent
5edddc13f2
commit
76ca910725
1 changed files with 8 additions and 1 deletions
|
|
@ -403,7 +403,6 @@ if .hdx_platform == "vector-internal" {
|
|||
.b.timestamp = tmp_timestamp
|
||||
|
||||
.h = .b.host
|
||||
.st = downcase(.b.level) ?? null
|
||||
.sv = .b."service.name"
|
||||
.ts = to_unix_timestamp(from_unix_timestamp(.b.timestamp, unit: "milliseconds") ?? now(), unit: "nanoseconds")
|
||||
.b._hdx_body = .b.message
|
||||
|
|
@ -412,6 +411,9 @@ if .hdx_platform == "vector-internal" {
|
|||
.b = merge(.b, structured, deep: true) ?? .b
|
||||
}
|
||||
|
||||
# set severity after merging structured message (to avoid conflict)
|
||||
.st = downcase(.b.level) ?? null
|
||||
|
||||
if exists(.b."rr-web.event") {
|
||||
.hdx_platform = "rrweb"
|
||||
temp_msg = .b.message
|
||||
|
|
@ -479,6 +481,11 @@ if is_object(.b) {
|
|||
.st = downcase(.b.level) ?? downcase(.b.severity) ?? downcase(.b.LEVEL) ?? downcase(.b.SEVERITY) ?? null
|
||||
}
|
||||
|
||||
# address .b.level and .st conflict
|
||||
if !is_nullish(.b.level) && .b.level != .st {
|
||||
.b.level = .st
|
||||
}
|
||||
|
||||
# merge vercel logs
|
||||
if is_object(.__hdx_logs) {
|
||||
tmp_b_size = strlen(encode_json(.b))
|
||||
|
|
|
|||
Loading…
Reference in a new issue