Skip to content

Conversation

alexander-alderman-webb
Copy link
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Oct 10, 2025

Description

Missing tags and breadcrumbs on sentry_sdk>=2.26.1 when lambda functions time out are an unintended consequences of 2d392af

You can verify the change with the new unit test.

To test manually:

  1. Clone this repo: https://github.com/getsentry/python-lambda-timeout-repro/tree/main.
  2. If you do not already have the sam cli installed, follow the instructions to install the cli: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html
  3. Stick a DSN in sam-app/hello_world/app.py.
  4. Use your local clone of the SDK in the lambda. In my case, I updated sam-app/hello_world/requirements.txt with
- sentry_sdk==2.26.1
+ /Users/alex/code/sentry-repos/sentry-python

Follow the commands to run the lambda in the README.md of the project. That is, in separate terminals run

sam local start-lambda --debug --template .aws-sam/build/template.yaml
sam local invoke HelloWorldFunction

Issues

More information about how I found the bug are described in #4912.

Closes #4894

Reminders

event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "threading", "handled": False},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can the mechanism be changed?

Keeping type=threading would keep it consistent with previous behaviour.

Changing this could help us distinguish AWS lambda timeout exceptions with exceptions caught by the threading integration that are unrelated to AWS lambda timeouts.

@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review October 10, 2025 14:49
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner October 10, 2025 14:49
cursor[bot]

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breadcrumbs and custom tags have stopped working since 2.20

1 participant