fix: move span k8s tag to root (#226)

This commit is contained in:
Warren 2024-01-10 23:05:03 -08:00 committed by GitHub
parent dc88a59da6
commit 3e885bfa2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,6 @@
---
'@hyperdx/api': patch
'@hyperdx/app': patch
---
fix: move span k8s tags to root

View file

@ -635,6 +635,24 @@ if is_object(.r) {
.b.process = tmp_process
.b.__events = .r.logs
# TODO: maybe we want to move "tag" to the root level
# extract k8s tags
if !is_nullish(.b.process.tag."k8s.pod.name") {
.b."k8s.pod.name" = del(.b.process.tag."k8s.pod.name")
}
if !is_nullish(.b.process.tag."k8s.pod.uid") {
.b."k8s.pod.uid" = del(.b.process.tag."k8s.pod.uid")
}
if !is_nullish(.b.process.tag."k8s.namespace.name") {
.b."k8s.namespace.name" = del(.b.process.tag."k8s.namespace.name")
}
if !is_nullish(.b.process.tag."k8s.node.name") {
.b."k8s.node.name" = del(.b.process.tag."k8s.node.name")
}
if !is_nullish(.b.process.tag."k8s.deployment.name") {
.b."k8s.deployment.name" = del(.b.process.tag."k8s.deployment.name")
}
if (.b."span.kind" == "server") {
if (exists(.b."http.status_code") && exists(.b."http.method") && exists(.b."http.route")) {
.b._hdx_body = join([