Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/aws-serverless/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ export function wrapHandler<TEvent, TResult>(
if (options.captureAllSettledReasons && Array.isArray(rv) && isPromiseAllSettledResult(rv)) {
const reasons = getRejectedReasons(rv);
reasons.forEach(exception => {
captureException(exception, scope => markEventUnhandled(scope));
captureException(exception, scope => markEventUnhandled(scope, 'auto.function.aws-serverless.promise'));
});
}
} catch (e) {
captureException(e, scope => markEventUnhandled(scope));
captureException(e, scope => markEventUnhandled(scope, 'auto.function.aws-serverless.handler'));
throw e;
} finally {
clearTimeout(timeoutWarningTimer);
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-serverless/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const headerGetter: TextMapGetter<APIGatewayProxyEventHeaders> = {
/**
* Marks an event as unhandled by adding a span processor to the passed scope.
*/
export function markEventUnhandled(scope: Scope): Scope {
export function markEventUnhandled(scope: Scope, type: string): Scope {
scope.addEventProcessor(event => {
addExceptionMechanism(event, { handled: false });
addExceptionMechanism(event, { handled: false, type });
return event;
});

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-serverless/test/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ describe('AWSLambda', () => {
// @ts-expect-error just mocking around...
expect(evtProcessor(event).exception.values[0]?.mechanism).toEqual({
handled: false,
type: 'generic',
type: 'auto.function.aws-serverless.handler',
Copy link
Member Author

@Lms24 Lms24 Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjusted the types to follow trace origin. It's not 100% identical to the span origin because for the span it's auto.function.serverless. However, I think we might wanna adjust that to .aws-serverless as the current one is likely a leftover of @sentry/serverless.

});
}
});
Expand Down
Loading