-
-
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?
Self-hosted/on-premise
Which SDK are you using?
@sentry/node
SDK Version
8.34.0
Framework Version
Node20 Express4
Link to Sentry event
No response
Reproduction Example/SDK Setup
Sentry.init({
dsn: sentryConfig.dsn,
environment: this.configService.env,
maxBreadcrumbs: 50,
integrations: [
nodeProfilingIntegration()
],
tracesSampleRate: 1.0,
profilesSampleRate: 1.0
})
const tags = sentryConfig.tags || {}
Sentry.setTags(tags)
this.express.use((req, res, next) => {
Sentry.withIsolationScope(null, (scope) => {
scope.setUser({ id: 'toto' })
next()
})
})
Steps to Reproduce
I want to set a user context for each request in my Express API.
Each request is sent to Sentry's performance monitoring, but I can't find any examples on how to add user context or extra data inside a transaction.
Could you provide an example?
Expected Result
Set user inside each sentry event
Actual Result
Need to increase it
Metadata
Metadata
Assignees
Labels
Projects
Status
No status