mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
perf: remove redundant otel-logs fields (timestamp + spanID + traceID) (#386)
Before: <img width="500" alt="Screenshot 2024-04-26 at 4 42 29 PM" src="https://github.com/hyperdxio/hyperdx/assets/5959690/74654fcd-faac-4837-8866-25f6e3e3e69e"> After: <img width="498" alt="Screenshot 2024-04-26 at 4 41 37 PM" src="https://github.com/hyperdxio/hyperdx/assets/5959690/9c34893f-d9f6-442d-a877-e04ea319471c">
This commit is contained in:
parent
f90a6873cd
commit
148c92b504
2 changed files with 15 additions and 6 deletions
6
.changeset/sweet-icons-boil.md
Normal file
6
.changeset/sweet-icons-boil.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
'@hyperdx/api': patch
|
||||
'@hyperdx/app': patch
|
||||
---
|
||||
|
||||
perf: remove redundant otel-logs fields (timestamp + spanID + traceID)
|
||||
|
|
@ -467,12 +467,9 @@ if .hdx_platform == "vector-internal" {
|
|||
}
|
||||
}
|
||||
|
||||
.r.timestamp = tmp_timestamp
|
||||
.b.timestamp = tmp_timestamp
|
||||
|
||||
.h = .b.host
|
||||
.sv = .b."service.name"
|
||||
.ts = to_unix_timestamp(from_unix_timestamp(.b.timestamp, unit: "milliseconds") ?? now(), unit: "nanoseconds")
|
||||
.ts = to_unix_timestamp(from_unix_timestamp(tmp_timestamp, unit: "milliseconds") ?? now(), unit: "nanoseconds")
|
||||
.b._hdx_body = .b.message
|
||||
structured = parse_json(.b.message) ?? null
|
||||
if is_object(structured) {
|
||||
|
|
@ -579,8 +576,14 @@ reroute_dropped = true
|
|||
source = '''
|
||||
# extract shared fields
|
||||
if is_object(.b) {
|
||||
.s_id = string(del(.b.span_id)) ?? string(del(.b.spanID)) ?? null
|
||||
.t_id = string(del(.b.trace_id)) ?? string(del(.b.traceID)) ?? null
|
||||
# extract span/trace id
|
||||
.s_id = string(.b.span_id) ?? string(.b.spanID) ?? null
|
||||
.t_id = string(.b.trace_id) ?? string(.b.traceID) ?? null
|
||||
del(.b.spanID)
|
||||
del(.b.span_id)
|
||||
del(.b.traceID)
|
||||
del(.b.trace_id)
|
||||
|
||||
.tso = to_unix_timestamp(now(), unit: "nanoseconds")
|
||||
|
||||
if is_nullish(.st) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue