From 4f4b2e86a96cbcf9230f953f0263b126b2d3c610 Mon Sep 17 00:00:00 2001 From: William Conti <58711692+wconti27@users.noreply.github.com> Date: Fri, 14 Feb 2025 11:13:57 -0500 Subject: [PATCH] remove span kind from inferred proxy spans (#5265) remove some unnecessary span information --------- Co-authored-by: Zarir Hamza --- packages/dd-trace/src/plugins/util/inferred_proxy.js | 4 +--- packages/dd-trace/test/plugins/util/inferred_proxy.spec.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/dd-trace/src/plugins/util/inferred_proxy.js b/packages/dd-trace/src/plugins/util/inferred_proxy.js index 83628084ead..5ee1664ceb5 100644 --- a/packages/dd-trace/src/plugins/util/inferred_proxy.js +++ b/packages/dd-trace/src/plugins/util/inferred_proxy.js @@ -2,7 +2,6 @@ const log = require('../../log') const tags = require('../../../../../ext/tags') const RESOURCE_NAME = tags.RESOURCE_NAME -const SPAN_KIND = tags.SPAN_KIND const SPAN_TYPE = tags.SPAN_TYPE const HTTP_URL = tags.HTTP_URL const HTTP_METHOD = tags.HTTP_METHOD @@ -49,7 +48,6 @@ function createInferredProxySpan (headers, childOf, tracer, context) { tags: { service: proxyContext.domainName || tracer._config.service, component: proxySpanInfo.component, - [SPAN_KIND]: 'internal', [SPAN_TYPE]: 'web', [HTTP_METHOD]: proxyContext.method, [HTTP_URL]: proxyContext.domainName + proxyContext.path, @@ -71,7 +69,7 @@ function createInferredProxySpan (headers, childOf, tracer, context) { function setInferredProxySpanTags (span, proxyContext) { span.setTag(RESOURCE_NAME, `${proxyContext.method} ${proxyContext.path}`) - span.setTag('_dd.inferred_span', '1') + span.setTag('_dd.inferred_span', 1) return span } diff --git a/packages/dd-trace/test/plugins/util/inferred_proxy.spec.js b/packages/dd-trace/test/plugins/util/inferred_proxy.spec.js index 0a02c149336..51d33f84389 100644 --- a/packages/dd-trace/test/plugins/util/inferred_proxy.spec.js +++ b/packages/dd-trace/test/plugins/util/inferred_proxy.spec.js @@ -81,9 +81,8 @@ describe('Inferred Proxy Spans', function () { expect(spans[0].meta).to.have.property('http.url', 'example.com/test') expect(spans[0].meta).to.have.property('http.method', 'GET') expect(spans[0].meta).to.have.property('http.status_code', '200') - expect(spans[0].meta).to.have.property('span.kind', 'internal') expect(spans[0].meta).to.have.property('component', 'aws-apigateway') - expect(spans[0].meta).to.have.property('_dd.inferred_span', '1') + expect(spans[0].metrics).to.have.property('_dd.inferred_span', 1) expect(spans[0].start.toString()).to.be.equal('1729780025472999936') expect(spans[0].span_id.toString()).to.be.equal(spans[1].parent_id.toString()) @@ -129,7 +128,6 @@ describe('Inferred Proxy Spans', function () { expect(spans[0].meta).to.have.property('http.url', 'example.com/test') expect(spans[0].meta).to.have.property('http.method', 'GET') expect(spans[0].meta).to.have.property('http.status_code', '500') - expect(spans[0].meta).to.have.property('span.kind', 'internal') expect(spans[0].meta).to.have.property('component', 'aws-apigateway') expect(spans[0].error).to.be.equal(1) expect(spans[0].start.toString()).to.be.equal('1729780025472999936')