getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.95k stars 1.57k forks source link

Profiling-node not detected by my npm #10787

Closed Abdussalam-Mujeeb-ur-rahman closed 7 months ago

Abdussalam-Mujeeb-ur-rahman commented 8 months ago

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

7.102.0

Framework Version

Node v20.9.0

Link to Sentry event

No response

SDK Setup

// configure sentry to capture logs
Sentry.init({
  dsn: process.env.sentry_DSN,
  integrations: [
    // enable HTTP calls tracing
    new Sentry.Integrations.Http({ tracing: true }),
    // enable express.js middleware testing
    new Sentry.Integrations.Express({ app }),
    new ProfilingIntegration(),
  ],
  // Performance Monitoring
  tracesSampleRate: 1.0, // Capture 100% of the transactions
  // Set sampling rate for profiling - this is relative to tracesSampleRate
  profilesSampleRate: 1.0,
});

Steps to Reproduce

I just installed @sentry/profiling-node and @sentry/node I followed installation instruction ran npm run dev

Expected Result

$ npm run dev

> sms@1.0.0 dev
> nodemon server

[nodemon] 3.0.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting `node server.js`
server is on 5002
MongoDB Connected: localhost

Actual Result

$ npm run dev

> sms@1.0.0 dev
> nodemon server

[nodemon] 3.0.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting `node server.js`
node:internal/modules/cjs/loader:1051
  throw err;
  ^

Error: Cannot find module 'C:\Users\Allahisrabb\Desktop\repository\SMS\node_modules\@sentry\profiling-node\lib\sentry_cpu_profiler-win32-ia32-115.node'
Require stack:
- C:\Users\Allahisrabb\Desktop\repository\SMS\node_modules\@sentry\profiling-node\lib\index.js
- C:\Users\Allahisrabb\Desktop\repository\SMS\server.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at importCppBindingsModule (C:\Users\Allahisrabb\Desktop\repository\SMS\node_modules\@sentry\profiling-node\lib\index.js:2481:12)
    at Object.<anonymous> (C:\Users\Allahisrabb\Desktop\repository\SMS\node_modules\@sentry\profiling-node\lib\index.js:2483:36)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Allahisrabb\\Desktop\\repository\\SMS\\node_modules\\@sentry\\profiling-node\\lib\\index.js',
    'C:\\Users\\Allahisrabb\\Desktop\\repository\\SMS\\server.js'
  ]
}

Node.js v20.9.0
[nodemon] app crashed - waiting for file changes before starting...
Lms24 commented 8 months ago

Hey @Abdussalam-Mujeeb-ur-rahman thanks for writing in! If you take a look in node_modules\@sentry\profiling-node\lib, are there any files in there? If yes, is the one in there that you get the error message for?

also cc @JonasBa any idea what might be going on here?

Abdussalam-Mujeeb-ur-rahman commented 8 months ago

The one I get the error (not found) for is not there at all. Thanks 🙏

On Thu, Feb 22, 2024 at 2:02 PM Lukas Stracke @.***> wrote:

Hey @Abdussalam-Mujeeb-ur-rahman https://github.com/Abdussalam-Mujeeb-ur-rahman thanks for writing in! If you take a look in @.***\profiling-node\lib, are there any files in there? If yes, is the one in there that you get the error message for?

also cc @JonasBa https://github.com/JonasBa any idea what might be going on here?

— Reply to this email directly, view it on GitHub https://github.com/getsentry/sentry-javascript/issues/10787#issuecomment-1959413078, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYXAZYRV2M2UNBDDWBPCEXLYU46VNAVCNFSM6AAAAABDU3M3U6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGQYTGMBXHA . You are receiving this because you were mentioned.Message ID: @.***>

lforst commented 8 months ago

I think win32-ia32 is an unsupported platform at the moment. We would need to add a binary for that I believe.

JonasBa commented 8 months ago

@Abdussalam-Mujeeb-ur-rahman @lforst is correct, that is not part of our supported platforms so we don't ship a precompiled binary. That said, the binary should attempt to compile itself from source on unsupported platforms as part of the installation process. The only reason where it wouldn't do that is if you are installing with --ignore-scripts option or if your npm config has ignore-scripts set to true (you can validate that with npm config get ignore-scripts which should return false)

Can you please validate that ignore scripts is not disabling the scripts from compiling? If it's set to false, would you mind cd into node_modules/@sentry/profiling-node and running the build:bindings:configure and build:bindings scripts and letting us know if they output any errors?

getsantry[bot] commented 7 months ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀