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
9.1.0
Framework Version
Express 4.21.2
Link to Sentry event
No response
Reproduction Example/SDK Setup
Sentry.init({
enabled: environment !== 'local' || process.env.SENTRY_ENABLED?.toLowerCase() === 'true',
environment,
dsn: process.env.SENTRY_DSN,
// Mark the release, this will help us pinpoint the source of issues
release: process.env.SHORT_SHA,
debug: process.env.SENTRY_DEBUG?.toLowerCase() === 'true',
tracesSampleRate: Number(process.env.SENTRY_TRACES_SAMPLE_RATE ?? 0.01),
profilesSampleRate: Number(process.env.SENTRY_PROFILES_SAMPLE_RATE ?? 0.01),
normalizeDepth: 10,
initialScope: {
tags: {
location: process.env.LOCATION ?? 'unknown',
container_name: process.env.CONTAINER_NAME ?? 'unknown',
},
},
integrations: [Sentry.prismaIntegration(), nodeProfilingIntegration()],
beforeBreadcrumb: (breadcrumb, _) => {
if (breadcrumb.category === 'http') {
// Ignore spans/breadcrumbs calling apm
const url = breadcrumb.data?.url;
if (url?.includes('.split.io/') || url?.includes('ingest.sentry.io/')) {
return null;
}
}
return breadcrumb;
},
beforeSendTransaction: (event, _) => {
// redact x-access-token from transactions
if (event.request?.headers && event.request?.headers['x-access-token']) {
event.request.headers['x-access-token'] = 'REDACTED';
}
return event;
},
ignoreTransactions: [/GET \/_health/, /GET \/_ready/, /GET \/_startup/, /OPTIONS \//],
});
Steps to Reproduce
- Capture traces with [email protected].
- Look at the
http.server
spans - Note the presence of two spans for the same endpoint within the same trace.
- Compare the two spans:
- The first span lacks child middleware spans (no expandable '+' indicator).
- The second span includes child middleware spans.
- The second span contains additional custom tags absent in the first span.
Expected Result
- Each unique operation (span) should be recorded only once per trace.
- All relevant context and middleware information should be consistently captured within a single span.
Actual Result
Duplicate spans for the same HTTP operation
More information on internal customer case
Metadata
Metadata
Assignees
Type
Projects
Status
Waiting for: Community