-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
request
not captured in @sentry/aws-serverless
+ express
#14239
Comments
Hey @relm923, thanks for reaching out. The latest docs on express can be found here. |
Hi @chargome removing import * as Sentry from '@sentry/aws-serverless';
Sentry.init({
debug: true,
dsn: process.env.SENTRY_DSN,
environment: 'development',
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
});
Sentry Logger [log]: Integration installed: InboundFilters
Sentry Logger [log]: Integration installed: FunctionToString
Sentry Logger [log]: Integration installed: LinkedErrors
Sentry Logger [log]: Integration installed: RequestData
Sentry Logger [log]: Integration installed: Console
Sentry Logger [log]: Integration installed: Http
Sentry Logger [log]: Integration installed: NodeFetch
Sentry Logger [log]: Integration installed: OnUncaughtException
Sentry Logger [log]: Integration installed: OnUnhandledRejection
Sentry Logger [log]: Integration installed: ContextLines
Sentry Logger [log]: Integration installed: LocalVariablesAsync
Sentry Logger [log]: Integration installed: Context
Sentry Logger [log]: Integration installed: ProcessAndThreadBreadcrumbs
Sentry Logger [log]: Integration installed: Modules
Sentry Logger [log]: Integration installed: Aws
Sentry Logger [log]: Integration installed: AwsLambda
Sentry Logger [log]: Running in CommonJS mode. import * as Sentry from '@sentry/aws-serverless';
Sentry.init({
debug: true,
dsn: process.env.SENTRY_DSN,
environment: 'development',
integrations: [Sentry.expressIntegration()],
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
});
Sentry Logger [log]: Integration installed: InboundFilters
Sentry Logger [log]: Integration installed: FunctionToString
Sentry Logger [log]: Integration installed: LinkedErrors
Sentry Logger [log]: Integration installed: RequestData
Sentry Logger [log]: Integration installed: Console
Sentry Logger [log]: Integration installed: Http
Sentry Logger [log]: Integration installed: NodeFetch
Sentry Logger [log]: Integration installed: OnUncaughtException
Sentry Logger [log]: Integration installed: OnUnhandledRejection
Sentry Logger [log]: Integration installed: ContextLines
Sentry Logger [log]: Integration installed: LocalVariablesAsync
Sentry Logger [log]: Integration installed: Context
Sentry Logger [log]: Integration installed: ProcessAndThreadBreadcrumbs
Sentry Logger [log]: Integration installed: Modules
Sentry Logger [log]: Integration installed: Aws
Sentry Logger [log]: Integration installed: AwsLambda
Sentry Logger [log]: Integration installed: Express
Sentry Logger [log]: Running in CommonJS mode. |
You won't need this integration since it gets auto-instrumented out of the box. Does the setup work like this? |
It does not work. Without the
Looking at the code it looks like
https://github.com/getsentry/sentry-javascript/blob/develop/packages/node/src/sdk/index.ts#L57 |
@relm923 some questions:
|
Transpiring with ESBuild to CJS and explicitly including I'm able to reproduce the same behavior locally without any bundling as well
Everything from RequestData |
Yeah, I guess it is true that we do not set the |
request
not captured in @sentry/aws-serverless
+ express
One question: You wrote this:
Is this some kind of standard, and if so, where is this defined? We get an I will put this in our backlog generally, as we are pretty swamped with stuff right now. PRs are also welcome if you want to take a stab yourself to fix this - you'd have to put code into the |
Generally for AWS Lambda I would expect the raw request/input to the lambda (event & context) and the express request/input (headers, method, etc) both be capture by Sentry. In v7 the express was automatically captured when using the Express integration I would also suggest updating the v8 docs as |
I think it makes sense to extract a proper request from the API Gateway spec, if it is there! Additionally, we could also store the event & context via
@relm923 What exactly do you mean? Do you mean that most auto instrumentation is not enabled by default in AWS? If yes, you are right - we should probably be more explicit on this in the setup docs! Do you mind opening a separate issue for this here: https://github.com/getsentry/sentry-docs so we can track this separately? Thank you! |
No concerns from my side, I think an opt-in option to capture event and context data makes sense. |
Yes |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/aws-serverless
SDK Version
8.37.1
Framework Version
AWS Lambda + Express 4.21.1
Link to Sentry event
https://patina-health.sentry.io/issues/5996169896?project=6044571
Reproduction Example/SDK Setup
Steps to Reproduce
Run the above code ideally deployed to AWS. Invoke with payload similar to:
Error is reported to Sentry but the
request
information is not includedExpected Result
Sentry event should include the
request
information.This worked correctly with the same setup on Sentry 7
Actual Result
Sentry event does include
aws.cloudwatch.logs
andaws.lambda
but no request informationThe text was updated successfully, but these errors were encountered: