Repository navigation
fix(aws-lambda): Remove messaging.batch.message_count from the Lambda span - #8229
Draft
sentry-junior[bot] wants to merge 4 commits into
Draft
sentry-junior[bot] wants to merge 4 commits into
sentry-junior[bot] wants to merge 4 commits into
Conversation
…NS batches The Lambda span set messaging.batch.message_count to 1 for every non-list event and to len(event) for a top-level list. An SQS or SNS delivery is a dict with Records, so a batch of 10 messages reported 1, and HTTP or direct invocations reported a batch they don't have. Set it only when all records come from SQS or SNS, to the number of records. Co-Authored-By: Johannes Daxböck <114897+dingsdax@users.noreply.github.com>
… span Replace the SQS/SNS record counting with a plain removal. The count belongs on messaging spans (boto3 receive and batch-send spans, and the queue.process span for SQS/SNS triggers), as in the OTel messaging conventions. The JS SDK doesn't set it on the Lambda span either. The attribute was added in 3.0 and never shipped in 2.x. Co-Authored-By: johdax <114897+dingsdax@users.noreply.github.com>
…event Co-Authored-By: Johannes Daxböck <114897+dingsdax@users.noreply.github.com>
This was referenced Nov 9, 2026
Contributor
Coverage Results 📊✅ 57835 passed | ❌ 1 failed | ⏭️ 3008 skipped | Total: 60844 | Pass Rate: 95.05% | Execution Time: 160m 46s 📊 Comparison with Base Branch
✅ Patch coverage is 100.00% (no changed executable lines found; target 80%). Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## master #8229 +/-##
==========================================
+ Coverage 90.35% 90.39% +0.04%
==========================================
Files 203 199 -4
Tracked lines 26931 21301 -5630
Branches 10058 7366 -2692
==========================================
- Hits 24331 19253 -5078
+ Misses 2600 2048 -552
+ Partials 1517 1234 -283Generated by Coverage Action |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Lambda span set
messaging.batch.message_countto1for every event that isn't a list, and tolen(event)for a top-level list. An SQS or SNS delivery is a dict withRecords, so a batch of 10 messages reported 1. HTTP calls and direct invocations reported a batch they don't have.This PR removes the attribute from the Lambda span. The count belongs on messaging spans, as in the OTel messaging conventions:
ReceiveMessageand batch-send spans already set it (feat(boto3): Add SQS extension #8137, feat(boto3): Add SNS extension #8142).queue.processspan in feat(aws-lambda): Add queue.process spans for messaging triggers #8223 sets it.The JS SDK doesn't set it on the Lambda span either. The attribute was added in 3.0 (#7941) and never shipped in 2.x, so no released behavior changes.
Replaces #8219 (same commits). GitHub never ran CI on #8219.
Note for review: this is narrower than PY-3015, which asks to keep the attribute for SQS/SNS deliveries. @alexander-alderman-webb, please confirm that's OK.
Issues
via @dingsdax.
--
View Session [Sentry]