-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
10.1.0
Framework Version
Node.js 22.x on AWS Lambda
Link to Sentry event
No response
Reproduction Example/SDK Setup
import * as Sentry from '@sentry/aws-serverless';
import { nodeProfilingIntegration } from '@sentry/profiling-node';
Sentry.init({
dsn: 'YOUR_DSN',
integrations: [nodeProfilingIntegration()],
tracesSampleRate: 0.75,
profileSessionSampleRate: 0.5,
profileLifecycle: 'trace',
});
Source maps uploaded via @sentry/esbuild-plugin with debug IDs injected.
Steps to Reproduce
- Set up Node.js profiling with
@sentry/profiling-nodeon AWS Lambda - Use
@sentry/esbuild-pluginto bundle TypeScript to ESM (.mjs) with debug IDs injected - Upload source maps to Sentry
- Trigger a profiled transaction
- Observe that error events have populated
debug_meta.imagesand symbolicate correctly - Observe that profile events have empty
debug_meta.imagesand show minified paths likefile:///var/task/index.mjswith bundled line numbers
Expected Result
Profile events should include populated debug_meta.images array with debug IDs, allowing flamegraphs to show original TypeScript file paths and line numbers (same as error events).
Actual Result
Profile events have empty debug_meta.images array. Flamegraphs show:
- Paths like
file:///var/task/packages/functions/src/internal/app.mjs - Bundled line numbers like
254965:21
Error events from the same codebase symbolicate correctly.
Root Cause:
In packages/core/src/utils/debug-ids.ts, getDebugImagesForResources() does a direct string lookup:
if (path && filenameDebugIdMap[path]) {However:
- The stack parser (
node-stack-trace.ts:112) stripsfile://when building the debug ID map - V8 profiler returns resources WITH the
file://prefix
So the lookup for file:///var/task/index.mjs fails because the map key is /var/task/index.mjs.
The existing test passes because it uses mocked resources without file:// prefix.
However:
The stack parser (node-stack-trace.ts:112) strips file:// when building the debug ID map
V8 profiler returns resources WITH the file:// prefix
So the lookup for file:///var/task/index.mjs fails because the map key is /var/task/index.mjs.
The existing test passes because it uses mocked resources without file:// prefix.
Additional Context
No response
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Metadata
Metadata
Assignees
Projects
Status