Skip to content

Add Redisson batch size attribute#19005

Merged
laurit merged 1 commit into
open-telemetry:mainfrom
trask:redisson-batch-size
Jun 16, 2026
Merged

Add Redisson batch size attribute#19005
laurit merged 1 commit into
open-telemetry:mainfrom
trask:redisson-batch-size

Conversation

@trask

@trask trask commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

  • emit db.operation.batch.size for Redisson CommandsData pipeline spans in stable DB semantic convention mode
  • exclude the MULTI transaction wrapper command from batch-size counting
  • add stable-mode pipeline assertions and document why current MULTI wrapper spans omit batch size

Testing

  • 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RedissonRequest for CommandsData and expose it via the DB attributes getter.
  • Emit db.operation.batch.size only when it represents a true batch (>1 user operations), excluding MULTI from the count.
  • Extend Redisson client/async client tests to assert db.operation.batch.size in stable semconv mode and document why MULTI wrapper 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.

@trask trask marked this pull request as ready for review June 15, 2026 21:58
@trask trask requested a review from a team as a code owner June 15, 2026 21:58
@laurit laurit merged commit 6bf5208 into open-telemetry:main Jun 16, 2026
95 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants