Repository navigation
fix(aws-lambda): Remove messaging.batch.message_count from the Lambda span - #8219
Draft
sentry-junior[bot] wants to merge 3 commits into
Draft
sentry-junior[bot] wants to merge 3 commits into
sentry-junior[bot] wants to merge 3 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>
Contributor
Coverage Results 📊✅ 57860 passed | ⏭️ 3008 skipped | Total: 60868 | Pass Rate: 95.06% | Execution Time: 157m 36s 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 13.33% (2 of 15 changed executable lines covered; target 80%). Changed files with executable lines (1)
Coverage diff@@ Coverage Diff @@
## master #8219 +/-##
==========================================
+ Coverage 90.31% 90.34% +0.03%
==========================================
Files 203 199 -4
Tracked lines 26933 21316 -5617
Branches 10058 7374 -2684
==========================================
- Hits 24321 19256 -5065
+ Misses 2612 2060 -552
+ Partials 1518 1233 -285Generated by Coverage Action |
… 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>
sentry-junior Bot
added a commit
that referenced
this pull request
Nov 9, 2026
…a span Keep the count on messaging spans only (boto3 receive and batch-send spans, and queue.process for SQS/SNS triggers), as in the OTel messaging conventions and the JS SDK. This drops the batch counting for Kafka, MQ and RabbitMQ deliveries, and matches #8219 so both PRs change these lines the same way. Co-Authored-By: johdax <114897+dingsdax@users.noreply.github.com>
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.
The first version of this PR counted SQS/SNS records instead. This version is smaller, and it removes the overlap with #8222.
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]