-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
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.37.1
Framework Version
N/A
Link to Sentry event
No response
Reproduction Example/SDK Setup
Node v20.18.0
NPM v10.8.2
package.json
{
"devDependencies": {
"@sentry/node": "^8.37.1",
"@sentry/profiling-node": "^8.37.1",
"tsx": "^4.19.2"
}
}
sentry-init.cjs
const Sentry = require('@sentry/node');
const { nodeProfilingIntegration } = require('@sentry/profiling-node');
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [
nodeProfilingIntegration()
],
environment: process.env.SENTRY_ENVIRONMENT,
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
attachStacktrace: true,
autoSessionTracking: true,
});
console.debug('Sentry initialized with environment:', process.env.SENTRY_ENVIRONMENT);
sentry-trace-repro.ts
import * as Sentry from '@sentry/node';
Sentry.startSpanManual({ name: 'Span test' }, (span) => {
console.log('span start')
setTimeout(() => {
console.log('span end')
span.end()
}, 3000);
});
Sentry.captureException(new Error('Test error'));
Steps to Reproduce
node --require ./sentry-init.cjs --import tsx sentry-trace-repro.ts
Test error is sent but span isn't, this is a smaller reproducer than express but use case is an app.ts with express running.
Expected Result
Span/Transaction on sentry
Actual Result
No span/transaction on sentry
Metadata
Metadata
Assignees
Labels
Projects
Status
No status