Fix DynamoDB batch attributes#18979
Merged
laurit merged 5 commits intoJun 15, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes DynamoDB stable database semconv behavior for AWS SDK v1.11 and v2.2 Batch* operations by deriving stable operation names from the actual number of request items, and emitting db.operation.batch.size for true batch requests.
Changes:
- Compute BatchGetItem/BatchWriteItem request item counts to decide between logical item operations (
GetItem/WriteItem) vs batch operations (BATCH GetItem/BATCH WriteItem). - Emit
db.operation.batch.sizewhen the computed batch size indicates a true batch request. - Extend test coverage (notably for AWS SDK v2.2) to validate stable batch attributes for multi-item requests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientCoreTest.java | Updates DynamoDB span assertions to handle item-vs-batch stable operation naming; adds multi-item batch tests asserting db.operation.batch.size. |
| instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/internal/DynamoDbAttributesExtractor.java | Adds batch-size extraction and stable semconv mapping for BatchGetItem/BatchWriteItem, including db.operation.batch.size emission. |
| instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractDynamoDbClientTest.java | Updates/extends BatchGetItem tests to distinguish single-item vs multi-item stable semantics and validate batch-size emission. |
| instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/internal/RequestAccess.java | Adds reflective accessor for getKeys() to enable batch-size counting for v1.11 BatchGetItem requests. |
| instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/internal/DynamoDbAttributesExtractor.java | Adds batch-size extraction and stable semconv mapping for BatchGetItem/BatchWriteItem, including db.operation.batch.size emission. |
trask
marked this pull request as ready for review
June 13, 2026 02:37
laurit
approved these changes
Jun 15, 2026
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.
Summary
Fixes DynamoDB stable database semconv batch handling for AWS SDK 1.11 and 2.2 instrumentation.
Previously,
BatchGetItemandBatchWriteItemstable operation names were based only on the AWS operation name. This PR counts the actual request items so that:BatchGetItem/BatchWriteItemrequests emit logical stable item operations (GetItem/WriteItem)BATCH GetItem/BATCH WriteItemdb.operation.batch.size