diff --git a/packages/core/tracing/sandbox/App.vue b/packages/core/tracing/sandbox/App.vue index 58dc016d60..f27acf9d27 100644 --- a/packages/core/tracing/sandbox/App.vue +++ b/packages/core/tracing/sandbox/App.vue @@ -6,3 +6,8 @@ + diff --git a/packages/core/tracing/sandbox/fixtures/trace-batches.json b/packages/core/tracing/sandbox/fixtures/trace-batches.json index 369770bd43..30f943e2d7 100644 --- a/packages/core/tracing/sandbox/fixtures/trace-batches.json +++ b/packages/core/tracing/sandbox/fixtures/trace-batches.json @@ -1 +1 @@ -{"batches":[{"resource":{"attributes":[{"key":"session.id","value":{"stringValue":"0193cf2f-943d-793a-819b-04ccf30948f3"}},{"key":"service.instance.id","value":{"stringValue":"4eb9bfce-d4fb-429d-b5d4-f37be1dfd680"}},{"key":"service.version","value":{"stringValue":"3.10.0.0"}},{"key":"service.name","value":{"stringValue":"kong"}}]},"scopeSpans":[{"scope":{"name":"kong-internal","version":"0.1.0"},"spans":[{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"jaw9O51b7eQ=","name":"kong","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1734347832732999936","endTimeUnixNano":"1734347833661143808","attributes":[{"key":"url.full","value":{"stringValue":"http://localhost/foo/anything"}},{"key":"http.response.status_code","value":{"doubleValue":200}},{"key":"network.peer.address","value":{"stringValue":"34.226.108.155"}},{"key":"proxy.kong.latency.upstream.ttfb","value":{"doubleValue":568}},{"key":"proxy.kong.latency.upstream.read_response_duration","value":{"doubleValue":1}},{"key":"proxy.kong.latency.total","value":{"doubleValue":927}},{"key":"proxy.kong.latency.redis.total_io","value":{"doubleValue":0}},{"key":"proxy.kong.latency.tcpsock.total_io","value":{"doubleValue":0}},{"key":"http.request.size","value":{"stringValue":"280"}},{"key":"proxy.kong.request.id","value":{"stringValue":"0f9fc8071dbf62141d8f136bbb4cdd39"}},{"key":"client.address","value":{"stringValue":"127.0.0.1"}},{"key":"network.protocol.name","value":{"stringValue":"http"}},{"key":"proxy.kong.service.id","value":{"stringValue":"6ac56e3e-6f02-417b-b683-3d8bcfa7a839"}},{"key":"network.peer.port","value":{"doubleValue":443}},{"key":"network.protocol.version","value":{"stringValue":"1.1"}},{"key":"proxy.kong.route.id","value":{"stringValue":"34627a0f-d67f-4aff-b5db-462e0d4ca1f3"}},{"key":"client.port","value":{"stringValue":"51632"}},{"key":"proxy.kong.upstream.id","value":{"stringValue":"060cc439-1fa0-4711-a87b-7721d71c4eb4"}},{"key":"http.request.method","value":{"stringValue":"POST"}},{"key":"proxy.kong.upstream.addr","value":{"stringValue":"34.226.108.155"}},{"key":"proxy.kong.upstream.host","value":{"stringValue":"34.226.108.155:443"}},{"key":"http.request.header.host","value":{"stringValue":"localhost"}},{"key":"proxy.kong.target.id","value":{"stringValue":"4fa11aba-7e12-48ff-9bc8-827db4939301"}},{"key":"http.route","value":{"stringValue":"/foo"}},{"key":"url.scheme","value":{"stringValue":"http"}}],"status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"eU4w1buq/ME=","parentSpanId":"jaw9O51b7eQ=","name":"kong.read_client_http_headers","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1734347832732999936","endTimeUnixNano":"1734347832733523456","attributes":[{"key":"proxy.kong.http.request.headers.count","value":{"doubleValue":8}},{"key":"proxy.kong.http.request.headers.size","value":{"doubleValue":195}}],"status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"Pq8AHC6l7/k=","parentSpanId":"jaw9O51b7eQ=","name":"kong.phase.rewrite","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734347832733757440","endTimeUnixNano":"1734347832734179072","status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"jB8u1zr5ziA=","parentSpanId":"jaw9O51b7eQ=","name":"kong.phase.access","kind":"SPAN_KIND_INTERNAL","endTimeUnixNano":"1734347832734516480","status":{},"events":[{"timeUnixNano":"1730397283960413400","attributes":[{"key":"message","value":{"stringValue":"exception"}},{"key":"exception.message","value":{"stringValue":"./kong/plugins/request-transformer/handler.lua:20: attempt to index global 'some_nil_variable' (a nil value)"}}],"droppedAttributesCount":0,"name":""}]},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"jB8u1zr5zig=","parentSpanId":"jaw9O51b7eQ=","name":"kong.phase.access","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734347832734516480","status":{},"events":[{"timeUnixNano":"1730397283960413400","attributes":[{"key":"message","value":{"stringValue":"exception"}},{"key":"exception.message","value":{"stringValue":"./kong/plugins/request-transformer/handler.lua:20: attempt to index global 'some_nil_variable' (a nil value)"}}],"droppedAttributesCount":0,"name":""}]},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"kvqrSQxXvCg=","parentSpanId":"jB8u1zr5zig=","name":"kong.router","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734347832734629632","endTimeUnixNano":"1734347832734826752","attributes":[{"key":"proxy.kong.router.matched","value":{"boolValue":true}},{"key":"proxy.kong.service.id","value":{"stringValue":"6ac56e3e-6f02-417b-b683-3d8bcfa7a839"}},{"key":"proxy.kong.route.id","value":{"stringValue":"34627a0f-d67f-4aff-b5db-462e0d4ca1f3"}},{"key":"proxy.kong.router.upstream_path","value":{"stringValue":"/"}}],"status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"Cur1GqHIG/8=","parentSpanId":"jB8u1zr5zig=","name":"kong.phase.access","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734347832735258880","endTimeUnixNano":"1734347832736532224","status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"TltE6SKF1Gw=","parentSpanId":"Cur1GqHIG/8=","name":"kong.router","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734347832735565312","endTimeUnixNano":"1734347832735602944","attributes":[{"key":"proxy.kong.router.matched","value":{"boolValue":true}},{"key":"proxy.kong.service.id","value":{"stringValue":"6ac56e3e-6f02-417b-b683-3d8bcfa7a839"}},{"key":"proxy.kong.route.id","value":{"stringValue":"34627a0f-d67f-4aff-b5db-462e0d4ca1f3"}},{"key":"proxy.kong.router.upstream_path","value":{"stringValue":"/"}}],"status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"VWA3UYCXUxs=","parentSpanId":"Cur1GqHIG/8=","name":"kong.access.plugin.acme","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734347832735847168","endTimeUnixNano":"1734347832735917568","attributes":[{"key":"proxy.kong.plugin.id","value":{"stringValue":"a34e6c20-3f98-4841-9858-3ca8a09095b7"}}],"status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"CfAKAQA8cJI=","parentSpanId":"Cur1GqHIG/8=","name":"kong.access.plugin.request-transformer","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734347832736018176","endTimeUnixNano":"1734347832736438528","attributes":[{"key":"proxy.kong.plugin.id","value":{"stringValue":"bdcb19c8-3dca-4ea9-8a0e-679fb50a3138"}}],"status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"9CpiF5ZqCak=","parentSpanId":"CfAKAQA8cJI=","name":"kong.read_client_http_body","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1734347832736348160","endTimeUnixNano":"1734347832736356096","status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"YSaVrPJeALo=","parentSpanId":"CfAKAQA8cJI=","name":"kong.read_client_http_body","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1734347832736419840","endTimeUnixNano":"1734347832736424960","status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"cjHPVXNFEgI=","parentSpanId":"jB8u1zr5zig=","name":"kong.read_client_http_body","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1734347832736904448","endTimeUnixNano":"1734347832736909312","status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"mziYy3y5MYI=","parentSpanId":"jB8u1zr5zig=","name":"kong.phase.header_filter","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734347833659182848","endTimeUnixNano":"1734347833659495168","status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"JAhrk1KDjxo=","parentSpanId":"jB8u1zr5zig=","name":"kong.phase.body_filter","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734347833659626752","endTimeUnixNano":"1734347833660816128","status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"izyzMU3IxCE=","parentSpanId":"jaw9O51b7eQ=","name":"kong.upstream.selection","kind":"SPAN_KIND_CLIENT","startTimeUnixNano":"1734347832737147392","endTimeUnixNano":"1734347833091174400","attributes":[{"key":"proxy.kong.upstream.lb_algorithm","value":{"stringValue":"round-robin"}},{"key":"try_count","value":{"doubleValue":1}},{"key":"proxy.kong.upstream.id","value":{"stringValue":"060cc439-1fa0-4711-a87b-7721d71c4eb4"}}],"status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"1pq1U0wCeVY=","parentSpanId":"izyzMU3IxCE=","name":"kong.upstream.try_select","kind":"SPAN_KIND_CLIENT","startTimeUnixNano":"1734347832737147392","endTimeUnixNano":"1734347833091174400","attributes":[{"key":"try_count","value":{"doubleValue":1}},{"key":"keepalive","value":{"boolValue":true}},{"key":"network.peer.name","value":{"stringValue":"httpbin.org"}},{"key":"network.peer.address","value":{"stringValue":"34.226.108.155"}},{"key":"proxy.kong.target.id","value":{"stringValue":"4fa11aba-7e12-48ff-9bc8-827db4939301"}},{"key":"network.peer.port","value":{"doubleValue":443}},{"key":"proxy.kong.latency.upstream.connect_duration","value":{"doubleValue":354}}],"status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"pNj/Jg8tINw=","parentSpanId":"jaw9O51b7eQ=","name":"kong.upstream.ttfb","kind":"SPAN_KIND_CLIENT","startTimeUnixNano":"1734347833091174400","endTimeUnixNano":"1734347833659174400","status":{}},{"traceId":"NIyrU6/7p6ncDoct0nEbgA==","spanId":"7peBX+7x154=","parentSpanId":"jaw9O51b7eQ=","name":"kong.upstream.read_response","kind":"SPAN_KIND_CLIENT","startTimeUnixNano":"1734347833659174400","endTimeUnixNano":"1734347833660174336","status":{}}]}]}]} +{"batches":[{"resource":{"attributes":[{"key":"service.instance.id","value":{"stringValue":"5445b0c8-417b-47a0-b747-c7565e925795"}},{"key":"service.version","value":{"stringValue":"3.10.0.0"}},{"key":"session.id","value":{"stringValue":"0193f2d3-3c27-72c1-8c98-968e21c0aee1"}},{"key":"service.name","value":{"stringValue":"kong"}}]},"scopeSpans":[{"scope":{"name":"kong-internal","version":"0.1.0"},"spans":[{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"XGRJrQWeLiY=","name":"kong","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1734945777892000000","endTimeUnixNano":"1734945778545911040","attributes":[{"key":"proxy.kong.route.id","value":{"stringValue":"d4783d0e-f7bd-41e5-b676-4bea060a4482"}},{"key":"proxy.kong.consumer.id","value":{"stringValue":"26c55ffc-ff1e-44ee-8c1d-a57d0efed5bb"}},{"key":"proxy.kong.upstream.id","value":{"stringValue":"unknown"}},{"key":"proxy.kong.latency.3p.redis.total_io","value":{"doubleValue":0}},{"key":"proxy.kong.upstream.addr","value":{"stringValue":"98.85.100.80"}},{"key":"proxy.kong.upstream.host","value":{"stringValue":"98.85.100.80:80"}},{"key":"proxy.kong.latency.client","value":{"doubleValue":1.230848}},{"key":"proxy.kong.target.id","value":{"stringValue":"unknown"}},{"key":"http.request.header.host","value":{"stringValue":"localhost"}},{"key":"proxy.kong.latency.upstream","value":{"doubleValue":553.02685546875}},{"key":"proxy.kong.request.id","value":{"stringValue":"15016151c88a7d6efdd9f70211390e00"}},{"key":"http.request.method","value":{"stringValue":"GET"}},{"key":"proxy.kong.latency.3p.total_io","value":{"doubleValue":97.96864}},{"key":"url.scheme","value":{"stringValue":"http"}},{"key":"http.request.size","value":{"stringValue":"177"}},{"key":"proxy.kong.latency.upstream.ttfb","value":{"doubleValue":273}},{"key":"network.protocol.version","value":{"stringValue":"1.1"}},{"key":"network.protocol.name","value":{"stringValue":"http"}},{"key":"proxy.kong.latency.3p.http_client.total_io","value":{"doubleValue":0}},{"key":"network.peer.address","value":{"stringValue":"98.85.100.80"}},{"key":"http.response.status_code","value":{"doubleValue":200}},{"key":"proxy.kong.latency.internal","value":{"doubleValue":0.7736565312499124}},{"key":"proxy.kong.latency.total","value":{"doubleValue":653}},{"key":"url.full","value":{"stringValue":"http://localhost/headers"}},{"key":"proxy.kong.latency.3p.tcpsock.total_io","value":{"doubleValue":0}},{"key":"http.route","value":{"stringValue":"/"}},{"key":"proxy.kong.latency.3p.dns.total_io","value":{"doubleValue":97.96864}},{"key":"client.port","value":{"stringValue":"54336"}},{"key":"proxy.kong.latency.upstream.read_response_duration","value":{"doubleValue":42}},{"key":"client.address","value":{"stringValue":"10.88.0.3"}},{"key":"network.peer.port","value":{"doubleValue":80}},{"key":"proxy.kong.service.id","value":{"stringValue":"1e4a129d-fc17-454f-91ae-e9e337d91ef7"}}],"status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"aacSUwadpqE=","parentSpanId":"XGRJrQWeLiY=","name":"kong.read_client_http_headers","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1734945777892000000","endTimeUnixNano":"1734945777892954368","attributes":[{"key":"proxy.kong.http.request.headers.count","value":{"doubleValue":7}},{"key":"proxy.kong.http.request.headers.size","value":{"doubleValue":154}}],"status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"PEs/Bv4uaTI=","parentSpanId":"XGRJrQWeLiY=","name":"kong.phase.rewrite","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734945777892962048","endTimeUnixNano":"1734945777893030656","status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"7pDGDX3R5Oo=","parentSpanId":"XGRJrQWeLiY=","name":"kong.phase.access","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734945777893038080","endTimeUnixNano":"1734945777992456960","status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"SjF7n5NjpnM=","parentSpanId":"7pDGDX3R5Oo=","name":"kong.router","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734945777893170176","endTimeUnixNano":"1734945777893306368","attributes":[{"key":"proxy.kong.router.matched","value":{"boolValue":true}},{"key":"proxy.kong.router.upstream_path","value":{"stringValue":"/"}},{"key":"proxy.kong.route.id","value":{"stringValue":"d4783d0e-f7bd-41e5-b676-4bea060a4482"}},{"key":"proxy.kong.service.id","value":{"stringValue":"1e4a129d-fc17-454f-91ae-e9e337d91ef7"}}],"status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"IassFhpADd4=","parentSpanId":"7pDGDX3R5Oo=","name":"kong.access.plugin.basic-auth","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734945777893407232","endTimeUnixNano":"1734945777893959680","attributes":[{"key":"proxy.kong.plugin.id","value":{"stringValue":"9159d5cf-a5c2-4b52-9b7b-ef8364738bd5"}}],"status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"+SHWMqgXcNI=","parentSpanId":"7pDGDX3R5Oo=","name":"kong.access.plugin.rate-limiting","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734945777893981696","endTimeUnixNano":"1734945777894172928","attributes":[{"key":"proxy.kong.plugin.id","value":{"stringValue":"6def3c80-02b6-4c06-9cc8-aa4b6054083d"}}],"status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"QS939BibQew=","parentSpanId":"7pDGDX3R5Oo=","name":"kong.access.plugin.request-transformer","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734945777894209280","endTimeUnixNano":"1734945777894420992","attributes":[{"key":"proxy.kong.plugin.id","value":{"stringValue":"a20e552b-a9ec-442e-8112-519fd4cba2cd"}}],"status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"ouLjxrSPI+U=","parentSpanId":"7pDGDX3R5Oo=","name":"kong.dns","kind":"SPAN_KIND_CLIENT","startTimeUnixNano":"1734945777894442496","endTimeUnixNano":"1734945777992443648","attributes":[{"key":"proxy.kong.dns.record.ip","value":{"stringValue":"98.85.100.80"}},{"key":"proxy.kong.dns.record.port","value":{"doubleValue":80}},{"key":"proxy.kong.dns.tries","value":{"arrayValue":{"values":[{"kvlistValue":{"values":[{"key":"msg","value":{"arrayValue":{"values":[{"stringValue":"cache-miss"}]}}},{"key":"qname","value":{"stringValue":"(short)httpbin.org"}}]}},{"kvlistValue":{"values":[{"key":"qtype","value":{"doubleValue":33}},{"key":"msg","value":{"arrayValue":{"values":[{"stringValue":"cache-miss"},{"stringValue":"querying"},{"stringValue":"dns server error: 3 name error"}]}}},{"key":"qname","value":{"stringValue":"httpbin.org"}}]}},{"kvlistValue":{"values":[{"key":"qtype","value":{"doubleValue":1}},{"key":"msg","value":{"arrayValue":{"values":[{"stringValue":"cache-miss"},{"stringValue":"querying"}]}}},{"key":"qname","value":{"stringValue":"httpbin.org"}}]}}]}}},{"key":"proxy.kong.dns.record.domain","value":{"stringValue":"httpbin.org"}}],"status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"VhrEVU4LHpU=","parentSpanId":"XGRJrQWeLiY=","name":"kong.read_client_http_body","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1734945777992481536","endTimeUnixNano":"1734945777992624128","status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"9lvYW/eP63k=","parentSpanId":"XGRJrQWeLiY=","name":"kong.phase.header_filter","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734945778503905792","endTimeUnixNano":"1734945778504432640","status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"QqQCNGmyUrQ=","parentSpanId":"XGRJrQWeLiY=","name":"kong.phase.body_filter","kind":"SPAN_KIND_INTERNAL","startTimeUnixNano":"1734945778545603072","endTimeUnixNano":"1734945778545764864","status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"UO4zpoqc014=","parentSpanId":"XGRJrQWeLiY=","name":"kong.upstream.selection","kind":"SPAN_KIND_CLIENT","startTimeUnixNano":"1734945777992626432","endTimeUnixNano":"1734945778230653440","attributes":[{"key":"proxy.kong.upstream.id","value":{"stringValue":"unknown"}},{"key":"try_count","value":{"doubleValue":1}},{"key":"proxy.kong.upstream.lb_algorithm","value":{"stringValue":"unknown"}}],"status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"5r+nlh8z2Os=","parentSpanId":"UO4zpoqc014=","name":"kong.upstream.try_select","kind":"SPAN_KIND_CLIENT","startTimeUnixNano":"1734945777992626432","endTimeUnixNano":"1734945778230653440","attributes":[{"key":"network.peer.port","value":{"doubleValue":80}},{"key":"try_count","value":{"doubleValue":1}},{"key":"network.peer.address","value":{"stringValue":"98.85.100.80"}},{"key":"proxy.kong.latency.upstream.connect_duration","value":{"doubleValue":238}},{"key":"keepalive","value":{"boolValue":true}},{"key":"network.peer.name","value":{"stringValue":"httpbin.org"}},{"key":"proxy.kong.target.id","value":{"stringValue":"unknown"}}],"status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"NkBDHdQ8Prk=","parentSpanId":"XGRJrQWeLiY=","name":"kong.upstream.ttfb","kind":"SPAN_KIND_CLIENT","startTimeUnixNano":"1734945778230653440","endTimeUnixNano":"1734945778503653376","status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"Tx2fk5OVCb4=","parentSpanId":"XGRJrQWeLiY=","name":"kong.upstream.read_response","kind":"SPAN_KIND_CLIENT","startTimeUnixNano":"1734945778503653376","endTimeUnixNano":"1734945778545653248","status":{}},{"traceId":"OO2ACWBe0hJbXNOOKR4m6A==","spanId":"bcQ4HvPhEGo=","parentSpanId":"XGRJrQWeLiY=","name":"kong.wait_for_client_read","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1734945778545764864","endTimeUnixNano":"1734945778545898752","status":{}}]}]}]} diff --git a/packages/core/tracing/src/components/trace-viewer/SpanAttribute.vue b/packages/core/tracing/src/components/trace-viewer/SpanAttribute.vue index a20470df3f..fb6318bcc0 100644 --- a/packages/core/tracing/src/components/trace-viewer/SpanAttribute.vue +++ b/packages/core/tracing/src/components/trace-viewer/SpanAttribute.vue @@ -30,7 +30,7 @@ import { ConfigCardItem, ConfigurationSchemaType, EntityLink, type EntityLinkData } from '@kong-ui-public/entities-shared' import { computed, inject, onWatcherCleanup, shallowRef, watch } from 'vue' import composables from '../../composables' -import { SPAN_ATTRIBUTE_VALUE_UNKNOWN, SpanAttributeKeys, TRACE_VIEWER_CONFIG } from '../../constants' +import { SPAN_ATTRIBUTE_KEYS, SPAN_ATTRIBUTE_VALUE_UNKNOWN, TRACE_VIEWER_CONFIG } from '../../constants' import type { EntityRequest, IKeyValue, SpanNode, TraceViewerConfig } from '../../types' import { getPhaseAndPlugin, unwrapAnyValue } from '../../utils' @@ -75,12 +75,12 @@ const formattedValue = computed(() => { // A map of keys of attributes whose values are IDs of entities (services, routes, consumers, etc.) // to their corresponding entities const ATTRIBUTE_KEY_TO_ENTITY: Record = { - [SpanAttributeKeys.KONG_SERVICE_ID]: 'services', - [SpanAttributeKeys.KONG_ROUTE_ID]: 'routes', - [SpanAttributeKeys.KONG_CONSUMER_ID]: 'consumers', - [SpanAttributeKeys.KONG_PLUGIN_ID]: 'plugins', - [SpanAttributeKeys.KONG_TARGET_ID]: 'targets', - [SpanAttributeKeys.KONG_UPSTREAM_ID]: 'upstreams', + [SPAN_ATTRIBUTE_KEYS.KONG_SERVICE_ID]: 'services', + [SPAN_ATTRIBUTE_KEYS.KONG_ROUTE_ID]: 'routes', + [SPAN_ATTRIBUTE_KEYS.KONG_CONSUMER_ID]: 'consumers', + [SPAN_ATTRIBUTE_KEYS.KONG_PLUGIN_ID]: 'plugins', + [SPAN_ATTRIBUTE_KEYS.KONG_TARGET_ID]: 'targets', + [SPAN_ATTRIBUTE_KEYS.KONG_UPSTREAM_ID]: 'upstreams', } // Let's only make the attributes listed above copyable, for now. @@ -110,7 +110,7 @@ const entityRequest = computed(() => { } switch (props.keyValue.key) { - case SpanAttributeKeys.KONG_PLUGIN_ID: { + case SPAN_ATTRIBUTE_KEYS.KONG_PLUGIN_ID: { // We will need to parse the plugin name from the span name request.plugin = getPhaseAndPlugin(props.span.name)?.plugin if (!request.plugin) { @@ -120,8 +120,8 @@ const entityRequest = computed(() => { } break } - case SpanAttributeKeys.KONG_TARGET_ID: { - const upstreamIdAttrValue = props.span.attributes?.find((attr) => attr.key === SpanAttributeKeys.KONG_UPSTREAM_ID)?.value + case SPAN_ATTRIBUTE_KEYS.KONG_TARGET_ID: { + const upstreamIdAttrValue = props.span.attributes?.find((attr) => attr.key === SPAN_ATTRIBUTE_KEYS.KONG_UPSTREAM_ID)?.value const upstreamId = upstreamIdAttrValue && unwrapAnyValue(upstreamIdAttrValue) if (!upstreamId) { console.warn(`Failed to look up the upstream ID for the upstream target in the span "${props.span.name}"`) diff --git a/packages/core/tracing/src/components/trace-viewer/SpanAttributeTable.vue b/packages/core/tracing/src/components/trace-viewer/SpanAttributeTable.vue index e605ebf032..a3e121333b 100644 --- a/packages/core/tracing/src/components/trace-viewer/SpanAttributeTable.vue +++ b/packages/core/tracing/src/components/trace-viewer/SpanAttributeTable.vue @@ -13,9 +13,9 @@ :span="span" /> -