Skip to content

Commit

Permalink
remove span kind from inferred proxy spans (#5265)
Browse files Browse the repository at this point in the history
remove some unnecessary span information

---------

Co-authored-by: Zarir Hamza <[email protected]>
  • Loading branch information
2 people authored and watson committed Feb 17, 2025
1 parent 785f1d0 commit 4f4b2e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions packages/dd-trace/src/plugins/util/inferred_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
}

Expand Down
4 changes: 1 addition & 3 deletions packages/dd-trace/test/plugins/util/inferred_proxy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 4f4b2e8

Please sign in to comment.