<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/aws-lambda-tracing-with-the-python-sdk-3zrtnqz8p" -->

---
title: AWS Lambda tracing with the Python SDK | daily.dev
description: Sentry's Python SDK 3.0 now continues a trace across synchronous Lambda Invoke calls and links SQS and SNS producers to their consumers. Before 3.0, traces...
canonical: https://daily.dev/posts/aws-lambda-tracing-with-the-python-sdk-3zrtnqz8p
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: AWS Lambda tracing with the Python SDK | daily.dev
og:description: Sentry's Python SDK 3.0 now continues a trace across synchronous Lambda Invoke calls and links SQS and SNS producers to their consumers. Before 3.0, traces...
og:url: https://daily.dev/posts/aws-lambda-tracing-with-the-python-sdk-3zrtnqz8p
og:image: https://api.daily.dev/og/posts/3ZRTNqz8p.png
og:image:alt: AWS Lambda tracing with the Python SDK
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS Lambda tracing with the Python SDK

**[Sentry Engineering](https://daily.dev/sources/sentry)** · 3 min read · 0 upvotes · 0 comments

## Summary

Sentry's Python SDK 3.0 now continues a trace across synchronous Lambda Invoke calls and links SQS and SNS producers to their consumers. Before 3.0, traces only connected when Lambda was triggered through an HTTP endpoint. Now a call like boto3.client("lambda").invoke() carries trace metadata in the custom client context, and the Boto3Integration, enabled by default, handles it. If the caller isn't Python, you put the sentry-trace and baggage values under custom in the client context yourself. For SQS and SNS, trace metadata travels as message attributes and links to the consumer's span.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.sentry.io/sentry-python-aws-lambda>

## Questions this post answers

### How do I continue a Sentry trace into a Lambda function I call with boto3 invoke in Python?

With Sentry's Python SDK 3.0, the Boto3Integration, enabled by default, passes trace metadata in the custom client context of a synchronous RequestResponse Lambda invoke. The AwsLambdaIntegration reads it inside the function, so the Lambda execution span continues the incoming trace. If the caller isn't Python, add the sentry-trace and baggage values under custom manually.

_Developers wiring up distributed tracing across AWS services follow this kind of SDK change on daily.dev._

### How can I link SQS or SNS producers to consumers in Sentry traces?

Pass trace metadata as message attributes when publishing. The Python SDK attaches it to the span tracing the consumer, which links the producer's trace to the consumer's trace. When you publish with boto3 and the Boto3Integration is active, the SDK does this automatically; otherwise you set the attributes yourself.

_Teams debugging event-driven AWS pipelines keep up with tracing improvements like this on daily.dev._

## Similar posts on daily.dev

- [End-to-End Trace Propagation Across SQS and Lambda with OpenTelemetry](https://daily.dev/posts/end-to-end-trace-propagation-across-sqs-and-lambda-with-opentelemetry-bfhkbr8co) · Last9 · 0 upvotes · 0 comments
- [How to Test SQS Workflows Locally with LocalStack and OpenTelemetry](https://daily.dev/posts/how-to-test-sqs-workflows-locally-with-localstack-and-opentelemetry-ur75xozum) · Last9 · 0 upvotes · 0 comments
- [Distributed Tracing Is Now in Beta for Ruby, PHP, and Python](https://daily.dev/posts/distributed-tracing-is-now-in-beta-for-ruby-php-and-python-lloes4nsi) · AppSignal · 0 upvotes · 0 comments
- [Bring faster visibility into AWS Lambda functions with remote instrumentation](https://daily.dev/posts/bring-faster-visibility-into-aws-lambda-functions-with-remote-instrumentation-tnyknbcja) · Datadog · 0 upvotes · 0 comments
- [Invoke AWS services directly from Amazon RDS for SQL Server 2025](https://daily.dev/posts/invoke-aws-services-directly-from-amazon-rds-for-sql-server-2025-svjqn5j6g) · AWS Database Blog · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#aws](https://daily.dev/tags/aws), [#devops](https://daily.dev/tags/devops), [#aws-lambda](https://daily.dev/tags/aws-lambda)

[View this post on daily.dev](https://daily.dev/posts/aws-lambda-tracing-with-the-python-sdk-3zrtnqz8p)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"AWS Lambda tracing with the Python SDK","url":"https://daily.dev/posts/aws-lambda-tracing-with-the-python-sdk-3zrtnqz8p","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/aws-lambda-tracing-with-the-python-sdk-3zrtnqz8p"},"datePublished":"2026-11-30T19:03:37.633Z","dateModified":"2026-11-30T19:03:56.031Z","description":"Sentry's Python SDK 3.0 now continues a trace across synchronous Lambda Invoke calls and links SQS and SNS producers to their consumers. Before 3.0, traces...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3e0324f35a72cbf7d06fe0b356743c2b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3e0324f35a72cbf7d06fe0b356743c2b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Sentry Engineering","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Sentry Engineering","logo":"https://media.daily.dev/image/upload/s--qqXwMThM--/f_auto/v1710505439/logos/sentry","url":"https://daily.dev/sources/sentry"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/aws-lambda-tracing-with-the-python-sdk-3zrtnqz8p","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,aws,devops,aws-lambda","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sentry Engineering","item":"https://daily.dev/sources/sentry"},{"@type":"ListItem","position":3,"name":"AWS Lambda tracing with the Python SDK"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/aws-lambda-tracing-with-the-python-sdk-3zrtnqz8p#faq","mainEntity":[{"@type":"Question","name":"How do I continue a Sentry trace into a Lambda function I call with boto3 invoke in Python?","acceptedAnswer":{"@type":"Answer","text":"With Sentry's Python SDK 3.0, the Boto3Integration, enabled by default, passes trace metadata in the custom client context of a synchronous RequestResponse Lambda invoke. The AwsLambdaIntegration reads it inside the function, so the Lambda execution span continues the incoming trace. If the caller isn't Python, add the sentry-trace and baggage values under custom manually. Developers wiring up distributed tracing across AWS services follow this kind of SDK change on daily.dev."}},{"@type":"Question","name":"How can I link SQS or SNS producers to consumers in Sentry traces?","acceptedAnswer":{"@type":"Answer","text":"Pass trace metadata as message attributes when publishing. The Python SDK attaches it to the span tracing the consumer, which links the producer's trace to the consumer's trace. When you publish with boto3 and the Boto3Integration is active, the SDK does this automatically; otherwise you set the attributes yourself. Teams debugging event-driven AWS pipelines keep up with tracing improvements like this on daily.dev."}}]}
```

