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

SourceMap Integration for NodejsFunction (minify esbuild bundle) #242

Open
MartinLoeper opened this issue Dec 20, 2023 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@MartinLoeper
Copy link

MartinLoeper commented Dec 20, 2023

Expected Behavior

I am fiddling around to get Error Tracking working using aws-cdk-v2, datadog-cdk-construct-v2 and NodejsFunction.
It would be nice to have this integrated into this construct library.

I do not know if the following setup is supported at all as there is a related issue in the dd-trace-js repository.

Expected behaviour is: When using a NodeJS Lambda function, I want error tracking in Datadog to show the source code in the stack trace (even for a handler which was bundled and minified via esbuild).

The reason why I believe this is important: The current sourceCodeIntegration does not seem to work out-of-the-box. APM error tracking cannot make sense of the NodeJS Lambda stack traces.

Actual Behavior

There is no matching source code file or source map for the bundled, minified Lambda handler /var/task/index.js.

Screenshot from 2023-12-20 17-48-27

Steps to Reproduce the Problem

  1. Use the datadog construct with .addGitCommitMetadata
  2. Use a NodejsLambda with the following bundling options:
bundling: {
        sourceMap: true,
        sourceMapMode: SourceMapMode.DEFAULT,
        sourcesContent: false,
        externalModules: [
          "dd-trace",
          "@aws-sdk/client-dynamodb",
          "@aws-sdk/client-s3",
          "@aws-sdk/lib-dynamodb",
        ],
        minify: true,
},
  1. Trigger an error span in APM for the Lambda function

Specifications

  • Datadog Lambda Layer version: 51 (extension), 101 (node)
  • Node version: 18
@MartinLoeper MartinLoeper changed the title SourceMap Integration for NodejsFunction SourceMap Integration for NodejsFunction (minify esbuild bundle) Dec 20, 2023
@duncanista duncanista added the bug Something isn't working label Feb 5, 2024
@purple4reina purple4reina added enhancement New feature or request and removed bug Something isn't working labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants