Repository navigation
fix(aws-lambda): Only set messaging.batch.message_count for messaging batches - #8161
Closed
ansh-rohilla wants to merge 1 commit into
Closed
ansh-rohilla wants to merge 1 commit into
ansh-rohilla wants to merge 1 commit into
Conversation
Contributor
|
Thanks for picking this up! Closing this for now, since we aren't sure yet how we're gonna implement this. For now there the new tests seem to test private helpers as well as mocks; it would be better to e.g. parameterize |
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
Previously,
messaging.batch.message_countwas set unconditionally on AWS Lambda streaming spans, defaulting to 1 for any non-list event (HTTP, S3, etc.) andlen(event)for top-level lists. Moreover, SQS and SNS deliveries in AWS Lambda come as a dictionary with aRecordslist, so a batch of 10 messages incorrectly reported 1.This PR:
_get_messaging_batch_count(aws_event)to identify recognized messaging services (AWS SQS and SNS) by checking whetherRecordsis present and belongs to SQS or SNS.messaging.batch.message_counton the span when the invocation event is a recognized messaging batch (SQS/SNS).batch_size(and consequentlyscope.set_tag("batch_size", ...)andscope.set_tag("batch_request", True)) reflects the number of records for SQS and SNS events.Issues
messaging.batch.message_countfor messaging batches #8078