Sentry Python AWS Lambda Tracing Across Invokes, SQS and SNS
GuidesDecember 5, 202611 min read

Sentry Python AWS Lambda Tracing Across Invokes, SQS and SNS

Sentry's Python SDK 3.0 now continues traces across Lambda Invoke calls and links SQS and SNS messages to their producers. Here's what changed, and a checklist for testing any tracer on async hops.

It's 2 a.m. and a customer's export never arrived. You open your tracing tool, find the request that kicked it off, and the trace just... ends. The handler called a Lambda function, the function dropped a message on a queue, a second function picked it up. Three steps. The dashboard shows you one of them.

That gap is what Sentry's Python SDK 3.0 goes after. In a short post dated November 30, 2026, Sentry's team describes "AWS Lambda tracing with the Python SDK". This guide walks through what the post says about Sentry Python AWS Lambda tracing, why trace continuity across queues is the hard part of serverless tracing, and how to test your own setup, whether it's Sentry, something else, or a mix.

Everything we say about Sentry below comes from that post, as of December 2026. We haven't run the SDK ourselves, so treat this as a reading of their announcement, not a benchmark.

What Sentry Python AWS Lambda tracing changed in 3.0

Sentry's own summary is short: with version 3.0 of the Python SDK, "we now connect Lambda invocations to the client and link how data flows through your AWS services." The post also says it focuses on trace-connectedness, which is what improved in 3.0. Three separate things are packed into that sentence.

1. Lambda Invoke propagation. Before 3.0, according to Sentry, "the trace was only connected when a Lambda function was triggered through an HTTP endpoint, where trace headers arrive in the event." Now it's also connected when you call the Lambda Invoke API synchronously, for instance with boto3.client("lambda").invoke(). The trace metadata travels in the custom client context of a RequestResponse invocation, and the Lambda execution span continues the incoming trace from it.

2. SQS and SNS linking. Publishers and consumers on Amazon SQS queues and SNS topics can be linked. You pass trace metadata as message attributes, and it's attached to the consumer's span. The producer's trace is then linked to the consumer's trace.

3. Bedrock spans. Sentry says Bedrock Converse and ConverseStream calls now create spans too, with model inputs, outputs and token usage. That's a separate topic from trace continuity, so we'll leave it there.

How you switch it on is also worth knowing. Sentry says the Boto3Integration is enabled by default when boto3 is installed, so publishing through boto3 gets the propagation for free. In the Lambda function itself you initialize the SDK with AwsLambdaIntegration, and it reads the incoming values.

And if your caller isn't Python, or you can't rely on that instrumentation? Sentry's post says you put the sentry-trace and baggage values by hand under custom in the client context (or, for queues, in the message attributes). That detail matters more than it looks. It tells you the mechanism isn't magic. It's two strings riding along with the call.

Why trace continuity across queues is hard

A trace is a family tree of spans that share an ID. Inside one process, the ID lives in memory and every child span just reads it. Across an HTTP call, the ID rides in a header, and every mainstream tracer knows to look there.

Lambda and queues break both assumptions.

Invoke has no standard header. An HTTP-triggered function receives headers in its event, so propagation is a solved problem. A direct Invoke call doesn't pass through an HTTP layer at all. Something has to smuggle the trace context into whatever slot the API offers, and the receiving side has to know which slot to read. That's why Sentry's fix lives in the client context, and why a non-Python caller needs manual work.

Queues decouple time. With a synchronous Invoke, the caller waits, so one trace covering both sides makes sense. With SQS the consumer might run a second later or an hour later, and one message can be retried. Stretching a single trace across that is misleading. A link is the more honest model: two traces, each complete on its own, with a pointer between them. Sentry's post uses exactly that language for SQS and SNS ("linked") and different language for Invoke ("continues the incoming trace").

Fan-out multiplies the questions. An SNS topic can feed several queues. Which consumer's trace links back to the producer? All of them? The producer's trace ends up with several children that start at different times. Your tool's UI has to render that sensibly.

Message attributes are a shared, limited resource. Trace context takes up attribute slots on every message. Amazon documents limits on message attributes for SQS and SNS, so check the current numbers on AWS's pages before you assume you have room to spare. We're not quoting figures here because we haven't verified today's values.

None of this is unique to Sentry. It's the shape of the problem for any tracer.

Continued versus linked: what to expect on screen

Once you understand the two models, you can predict what a working setup looks like.

For a synchronous Invoke, you should see one trace containing the caller's span and the Lambda execution span as its descendant. One trace ID, one waterfall. Duration of the child nests inside the parent.

For SQS or SNS, you should see two traces. The consumer's trace has its own ID and its own root span, plus a link to the producer's trace. A good UI lets you click from one to the other. A weaker one shows the link as a raw ID you paste into a search box, which we'd call a UI bug, not a feature. Nobody debugs at 2 a.m. by copying hex strings between tabs.

If instead you see the consumer's trace as a standalone root with nothing pointing back, the context didn't make it across. That's the failure you're hunting for. It's also the most common outcome with a tracer that was set up for HTTP and never taught about queues. (We say "common" as a judgement from how these systems are built, not from a survey.)

A checklist for judging any tracer on async hops

Here's the part that applies no matter who you pay. Run it against your real architecture, not the happy path in a vendor's demo.

  1. List every hop in one real flow. Direct Invoke, API Gateway, SQS, SNS, EventBridge, Step Functions, whatever you actually use. Be honest about it. It's easy to forget one.
  2. Tag one request and send it through. Use a unique value, a test user ID, a custom header, anything you can search for later.
  3. Look for continuity at each hop. Same trace ID for synchronous calls. An explicit link for queued ones. Write down which hops pass and which don't.
  4. Check the non-Python edge. If a Node, Go or Java service sits in the chain, does the context cross it? Sentry's post says a caller that isn't written in Python needs the values added by hand, which is a fair thing to expect from any SDK.
  5. Check retries and dead letters. A retried message shouldn't create a mystery. See what the consumer's trace looks like on the second attempt.
  6. Check fan-out. Publish to a topic with more than one subscriber and confirm every consumer connects back.
  7. Check cold starts. Does the first invocation of a fresh container still carry context, and does the cold-start cost show up as its own span?
  8. Check sampling. If the producer's trace was sampled out, what does the consumer do? A link to a trace that was never stored is a dead end. A sample rate of 1.0 is fine while you test. Copy it into production without thinking and the bill will tell you about it.
  9. Check what you'd see during an incident. Can you start from an error on the consumer and walk back to the original request in under a minute? That's the real test.

If a tool passes the first three and fails the rest, you still have something useful. You just know where the blind spots are before 2 a.m. finds them.

What the Sentry post doesn't tell you

It's a two-minute read, and it leaves things out. That's normal for a product announcement, but it's worth naming so you don't over-read it.

It doesn't say how batch consumption from SQS is handled, where one invocation receives many messages, each from a different producer trace. It doesn't mention EventBridge or Step Functions. It doesn't say what happens when the producer is sampled out. And it can't tell you how any of this looks with your volumes, your retries and your odd legacy function.

Not a criticism. But "supports SQS" is one of the most slippery phrases in observability docs. It can mean anything from "links every message" to "we don't crash on it", and vendors rarely say which. The checklist above is how you find out.

Sentry plus Datadog, or one tool?

A lot of teams run an error tracker next to an APM product, Sentry plus Datadog being a common pairing. That's a legitimate setup. It also means every async hop has two chances to lose context, one per tool, and two bills to read.

Our bias is plain: JustAnalytics is built as a consolidation play, with error tracking, APM and distributed tracing, session replay, uptime and logs in one platform, and it's OpenTelemetry-native. If you've already got a tracing setup that crosses your hops cleanly, you don't need to change anything because we said so. Our case against a five-tool observability stack lays out the cost of stitching tools together, and it's honest about when a split stack is fine.

What we'd push you toward is the checklist, applied to every tool in your current stack, ours included. We can't tell you from here whether our tracer passes your particular hops. Run the test.

If you want the underlying mechanics before you test, how distributed tracing context survives async work explains the context-passing idea in a language-neutral way, and the APM and distributed tracing glossary defines terms like span link and trace propagation. For serverless-specific tradeoffs, the Baselime comparison is the closest we have.

One practical aside. Alerts about a broken async pipeline usually go out by email, and a tracing tool that finds the break is only useful if the notice reaches someone. If you route alerts through your own domain, JustEmails handles the mail side, with a worked SMTP setup for self-hosted alerting showing the pattern.

What to do this week

Keep it small.

  • Pick the one flow whose failure costs you the most. Not the whole system.
  • Run the first three checklist items on it, with whatever tool you use today.
  • If you're on Sentry's Python SDK, read the 2.x to 3.x migration guide that Sentry's post points to before you upgrade, since the version jump from 2.x is a major one.
  • Write down which hops lost context. That list is your real requirement when you compare tools, instead of a feature matrix.

Honestly, most of the value here isn't in picking a winner. It's in knowing, for the first time, which of your hops are invisible.

FAQ

What did Sentry's Python SDK 3.0 change for AWS Lambda tracing?

Per Sentry's blog post of November 30, 2026, the trace now stays connected when you call the Lambda Invoke API synchronously, for example through boto3. Before 3.0 it was only connected when a function was triggered through an HTTP endpoint. SQS and SNS publishers and consumers can also be linked.

Is a linked trace the same as a continued trace?

No. A continued trace is one trace spanning both sides, as with a synchronous Invoke. A link keeps the producer's and consumer's traces separate and points one at the other, which suits queues where the consumer may run much later.

How do I check whether my own traces break at async boundaries?

Send one tagged request through each hop you run (a direct Invoke, a queue message, a topic publish) and look for a single trace ID, or an explicit link, on the consumer side. A consumer span that shows up as an orphan root is the failure to look for.

Do I need Sentry plus Datadog to cover Lambda tracing?

Not by definition. The question is which hops your system actually has and whether each tool you're paying for keeps context across them. Run the checklist against your real architecture before you decide on a stack.


Try JustAnalytics

All-in-one observability in one under-5KB script: cookieless analytics + error tracking + APM + session replay + uptime + structured logs. Replaces GA4 + Sentry + Datadog + Pingdom + LogRocket. Free tier (100K events/mo), Pro $49/month ($39/month billed annually).

Start free → · AI Command Center MCP

JP
JustAnalytics Platform TeamContributor

Author at JustAnalytics.

Related posts