Skip to content

request not captured in @sentry/aws-serverless + express #14239

Open
@relm923

Description

@relm923

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

import * as Sentry from '@sentry/aws-serverless';

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  environment: 'development',
  integrations: [Sentry.expressIntegration()],
  tracesSampleRate: 1.0,
  profilesSampleRate: 1.0,
});

import * as Sentry from '@sentry/aws-serverless';
import express from 'express';
import serverless from 'serverless-http';

const app = express();

app.get('/debug-sentry', (req, res) => {
  throw new Error('My first Sentry error!');
});

Sentry.setupExpressErrorHandler(app);

export const handler = Sentry.wrapHandler(serverless(app));

Steps to Reproduce

Run the above code ideally deployed to AWS. Invoke with payload similar to:

{
  "headers": { "content-type": "application/json" },
  "httpMethod": "GET",
  "path": "/debug-sentry"
}

Error is reported to Sentry but the request information is not included

Expected 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 and aws.lambda but no request information

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions