Repository navigation
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
10.43.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
test.ts:
import * as Sentry from '@sentry/node';
import express from 'express';
const app = express();
app.get('/', async (_req, res) => {
Sentry.captureException(new Error('Test Error'));
Sentry.logger.info('Test Log');
res.end('ok');
});
app.listen(3000, () => {
console.log(`App listening on port 3000`);
});instrument.ts:
import * as Sentry from '@sentry/node';
process.loadEnvFile();
Sentry.init({
enableLogs: true,
});node --import ./src/instrument.ts src/test.tsNode.js v25.8.1, Express.js v5.2.1
Steps to Reproduce
- go to http://localhost:3000 a few times
- check sentry ui for trace id
Expected Result
Each event should have a different trace id
Actual Result
When tracing is disabled all errors from different requests are assigned the same traceId.
This is visible in the Trace Preview:

Additional Context
Shouldn't each request have a unique traceId even when tracing is disabled (tracesSampleRate is undefined)? This behavior can be quite confusing during debugging. It creates a false impression that unrelated errors/logs are part of the same request or execution flow.
If this is the intended behavior, is there a way to manually generate/reset a new traceId for each request without enabling tracing?
I've posted this originally as a question #19610
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsNo status

Activity
linear-code commentedon Mar 16, 2026
JS-1942
Lms24 commentedon Mar 17, 2026
Hi, thanks for writing in! I can reproduce this. Gonna take a look at what we can do to fix this. I agree. As long as our
httpIntegrationis used, we should isolate traces per request.Lms24 commentedon Mar 17, 2026
I opened #19835 to explicitly recycle the traceId on our fallback propagationContext, tracing is disabled. This should fix your issue and likely also resolve some of the linked ones.
We'll publish the fix with the next release
mnow-cd commentedon Mar 17, 2026
Thanks for the quick fix. Looking forward to the release
fix(node-core): Recycle propagationContext for each request (#19835)
mnow-cd commentedon Mar 19, 2026
Hey @Lms24,
While waiting for the release, I took a look at your changes.
Could I implement a similar approach in a module that doesn't have instrumentation?
Example:
Is this approach safe?
Looking at
withIsolationScopedescription or_INTERNAL_safeMathRandomname, this might be not a good idea :)Thanks.
github-actions commentedon Mar 19, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #19835, which was included in the 10.45.0 release.
Lms24 commentedon Mar 19, 2026
@mnow-cd yes this should work! The primary intention for isolation scopes is that you (as an SDK user) don't have to interact with but let us handle this for you. I assume you're working on some kind of queue system that we don't instrument, so the code you shared looks reasonable :)
You might not even need
_INTERNAL_safeMathRandombut just go withMath.random(). This is something we have to use because NextJS no longer allows use randomness APIs when the SDK is used in a NextJS project.mnow-cd commentedon Mar 19, 2026
@Lms24 thank you for the confirmation.
Also I tested the fix, and now trace id is different for each request, perfect! Thanks again.