Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still have express is not instrumented. error #15159

Closed
3 tasks done
webPlayer7 opened this issue Jan 24, 2025 · 2 comments
Closed
3 tasks done

Still have express is not instrumented. error #15159

webPlayer7 opened this issue Jan 24, 2025 · 2 comments
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@webPlayer7
Copy link

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

8.51.0

Framework Version

Express v5

Link to Sentry event

No response

Reproduction Example/SDK Setup

import * as Sentry from '@sentry/node'


Sentry.init({
    dsn: process.env.SENTRY_DSN,
    environment: process.env.SENTRY_ENVIRONMENT,
    release: appVersion,
    tracesSampleRate: 0.0,
})

console.log(`================================`)
console.log(`****** Sentry Initialized ******`)
console.log('================================')

export { Sentry }

Above is my sentry instrument js and I import that file in the index.js like below
import { Sentry } from './instrument.js'

I confirmed it gets the correct env values. My express version is v5. And I use esm mode to import so I run this command to import instrument.js
nodemon --import ./build/instrument.js build/index.js

When I use express v4, it worked but after migrate it shows sentry warning again

[1] [Sentry] express is not instrumented. Please make sure to initialize Sentry in a separate file that you --import when running node, see: https://docs.sentry.io/platforms/javascript/guides/express/install/esm/.

Steps to Reproduce

  1. Sentry init in instrument.js
  2. Import instrument.js in index.js
  3. Run script in esm mode , use --import flag to import

Expected Result

There should no sentry warning

Actual Result

[1] [Sentry] express is not instrumented. Please make sure to initialize Sentry in a separate file that you --import when running node, see: https://docs.sentry.io/platforms/javascript/guides/express/install/esm/.

There is sentry warning

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 24, 2025
@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Jan 24, 2025
@Lms24
Copy link
Member

Lms24 commented Jan 24, 2025

Hi, thanks for writing in! You're getting this warning because Express 5 is not yet supported by Opentelemetry's Express instrumentation. See open-telemetry/opentelemetry-js-contrib#2435

For the moment, you will not get Express spans in your traces. As for error capturing, I'm not a 100% sure but I think it should work (tagging @AbhiPrasad or @timfish to confirm).

@mydea
Copy link
Member

mydea commented Jan 27, 2025

Error monitoring should work fine. I updated the tracking issue here: #13674 to show the current state right away, hopefully making this a bit clearer. I'll close this as a duplicate, you can follow along in the linked issue! I also opened a docs PR to call this out for future readers: getsentry/sentry-docs#12465

@mydea mydea closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK
Projects
Archived in project
Development

No branches or pull requests

3 participants