Skip to content

All errors are assigned to the same trace when tracing is disabled #19815

@mnow-cd

Description

@mnow-cd

Is there an existing issue for this?

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.ts

Node.js v25.8.1, Express.js v5.2.1

Steps to Reproduce

  1. go to http://localhost:3000 a few times
  2. 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:
image

Image

Trace logs:
Image

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?

Ref: #17101, #18517

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

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions