Add Redisson batch size attribute#19005
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for emitting the stable DB semantic convention attribute db.operation.batch.size on Redisson pipeline (CommandsData) spans, while ensuring the MULTI transaction wrapper command is excluded from batch-size counting.
Changes:
- Add batch-size computation on
RedissonRequestforCommandsDataand expose it via the DB attributes getter. - Emit
db.operation.batch.sizeonly when it represents a true batch (>1 user operations), excludingMULTIfrom the count. - Extend Redisson client/async client tests to assert
db.operation.batch.sizein stable semconv mode and document whyMULTIwrapper spans omit it.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| instrumentation/redisson/redisson-common-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/common/v3_0/RedissonRequest.java | Computes batch size for CommandsData requests and excludes MULTI wrapper from the count. |
| instrumentation/redisson/redisson-common-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/common/v3_0/RedissonDbAttributesGetter.java | Exposes the computed batch size through DbClientAttributesGetter. |
| instrumentation/redisson/redisson-common-3.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonClientTest.java | Adds stable-mode assertions for db.operation.batch.size on pipeline spans and documents MULTI wrapper behavior. |
| instrumentation/redisson/redisson-common-3.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonAsyncClientTest.java | Documents MULTI wrapper span omission rationale in async atomic batch test coverage. |
laurit
approved these changes
Jun 16, 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
db.operation.batch.sizefor RedissonCommandsDatapipeline spans in stable DB semantic convention modeMULTItransaction wrapper command from batch-size countingMULTIwrapper spans omit batch sizeTesting
git diff --check -- instrumentation/redisson/redisson-common-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/common/v3_0/RedissonDbAttributesGetter.java instrumentation/redisson/redisson-common-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/common/v3_0/RedissonRequest.java instrumentation/redisson/redisson-common-3.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonAsyncClientTest.java instrumentation/redisson/redisson-common-3.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonClientTest.java./gradlew :instrumentation:redisson:redisson-common-3.0:javaagent:spotlessCheck :instrumentation:redisson:redisson-common-3.0:testing:spotlessCheck :instrumentation:redisson:redisson-3.0:javaagent:compileTestJava :instrumentation:redisson:redisson-3.17:javaagent:compileTestJava