Skip to content

Commit

Permalink
Revert "Use the existing context if any to start the web spans (#1647)"
Browse files Browse the repository at this point in the history
This reverts commit 6c55168.
  • Loading branch information
Qard committed Dec 20, 2022
1 parent b2cd49c commit fc12cd1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
3 changes: 1 addition & 2 deletions packages/dd-trace/src/plugins/util/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ const web = {

// Extract the parent span from the headers and start a new span as its child
startChildSpan (tracer, name, headers) {
const childOf = tracer.scope().active() || tracer.extract(FORMAT_HTTP_HEADERS, headers)

const childOf = tracer.extract(FORMAT_HTTP_HEADERS, headers)
const span = tracer.startSpan(name, { childOf })

return span
Expand Down
9 changes: 0 additions & 9 deletions packages/dd-trace/test/plugins/util/web.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,6 @@ describe('plugins/util/web', () => {
})
})

it('should set the parent from the active context if any', () => {
tracer.trace('aws.lambda', parentSpan => {
web.instrument(tracer, config, req, res, 'test.request', span => {
expect(span.context()._traceId.toString(10)).to.equal(parentSpan.context()._traceId.toString(10))
expect(span.context()._parentId.toString(10)).to.equal(parentSpan.context()._spanId.toString(10))
})
})
})

it('should set the service name', () => {
config.service = 'custom'

Expand Down

0 comments on commit fc12cd1

Please sign in to comment.