Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.35.0
Framework Version
hapi 21.3.10
Link to Sentry event
No response
Reproduction Example/SDK Setup
https://github.com/nlochschmidt/sentry-duplicate-tracing-bug
Steps to Reproduce
- I've setup Sentry and a custom otel setup as described in the docs we are not using Sentry for tracing but another service
- Running the server I can see from the logs that instrumentations are setup
- When I call the server e.g.
curl localhost:3000
I get aspanId
andtraceId
from inside the handler - The
ConsoleSpanExporter
will print the traces and spans collected after a short time.
Expected Result
I expect to get a single trace with two spans (one for http and one for hapi).
Actual Result
What actually happens is that there are three traces and only one of them (traceId: 9dbf48ed9eee5aa66cba36df77eef90b
) has the two spans that are expected, while the other two traces have only a single http root span.
I can see some odd instrumentation scopes @opentelemetry_sentry-patched/instrumentation-http
, but interestingly the @opentelemetry/instrumentation-http
is on one of the traces with a single span.
Here is the output cleaned up a bit (full output in the example repo README):
{
traceId: '9dbf48ed9eee5aa66cba36df77eef90b',
id: '86279d018d1d20f4',
parentId: 'bb6216be501f6924',
instrumentationScope: {
name: '@opentelemetry/instrumentation-hapi',
},
name: 'route - /',
kind: 0,
attributes: {
'sentry.sample_rate': 1
},
status: { code: 0 },
}
{
traceId: '04de96dc9304e6376ac87ffa038e53f4',
id: 'e68a07918c660533',
parentId: undefined,
instrumentationScope: {
name: '@opentelemetry/instrumentation-http',
},
name: 'GET',
kind: 1,
attributes: {
'sentry.sample_rate': 1,
'sentry.parentIsRemote': true,
},
status: { code: 0 },
}
{
traceId: 'e82eb8fe28439cad4cb409199d1759f3',
id: '01cf0d4b96a81e61',
parentId: undefined,
instrumentationScope: {
name: '@opentelemetry_sentry-patched/instrumentation-http',
},
name: 'GET',
kind: 1,
attributes: {
'sentry.sample_rate': 1,
'sentry.parentIsRemote': true,
'sentry.origin': 'auto.http.otel.http',
},
status: { code: 0 },
events: [],
links: []
}
{
traceId: '9dbf48ed9eee5aa66cba36df77eef90b',
id: 'bb6216be501f6924',
parentId: undefined,
instrumentationScope: {
name: '@opentelemetry_sentry-patched/instrumentation-http',
},
name: 'GET',
kind: 1,
attributes: {
'sentry.sample_rate': 1,
'sentry.parentIsRemote': true,
'sentry.origin': 'auto.http.otel.http',
},
status: { code: 0 },
}
It works as expected when removing Sentry
Metadata
Metadata
Assignees
Type
Projects
Status
Waiting for: Product Owner