← All platforms

AWS Lambda (Python) error tracking

The invocation may be over before you hear about it. The Sentry Python SDK sends Lambda error reports to Telebugs, where they stay on your server.

~/hoofnotes  pip install sentry-sdk -t package
~/hoofnotes  nvim lambda_function.py
import sentry_sdk
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
sentry_sdk.init(
# Copy the complete Telebugs DSN, key and path included.
dsn="YOUR_TELEBUGS_DSN",
integrations=[AwsLambdaIntegration()],
)
from hoofnotes.handlers import lambda_handler
~/hoofnotes  sam local invoke

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep sentry-sdk and change its destination to your Telebugs DSN. Your error reports stay on your server. You don’t need a Sentry account.

Does the report outlive the invocation?

Yes. The Lambda integration handles sending captured errors before the invocation finishes. Once received, the report stays in Telebugs after the function stops.

Can a Lambda reach a self-hosted tracker?

Yes, provided your Telebugs endpoint is reachable from the function. If your Lambda runs inside a private network, that network needs a route to your server.