Skip to content

Normalize Redis batch query separators - #19164

Merged
trask merged 3 commits into
open-telemetry:mainfrom
trask:fix-redis-batch-query-separators
Jul 10, 2026
Merged

trask merged 3 commits into
open-telemetry:mainfrom
trask:fix-redis-batch-query-separators

Conversation

@trask

@trask trask commented Jul 9, 2026 •

Copy link
Copy Markdown
Member

Normalize Redis batch db.query.text joins to use semicolon-plus-space separators across Jedis, Redisson, Lettuce 5.0, and Vert.x Redis whenever stable database semantic conventions are emitted, including database/dup mode. Old-only semconv mode continues to emit the existing compact db.statement separator, and existing truncation behavior is preserved.

@trask
trask force-pushed the fix-redis-batch-query-separators branch 2 times, most recently from 5219853 to 1671c8e Compare July 9, 2026 18:45
@trask
trask force-pushed the fix-redis-batch-query-separators branch from 1671c8e to b2126ef Compare July 9, 2026 18:53
@trask
trask requested a review from Copilot July 9, 2026 18:56

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 normalizes the separator used when joining multiple Redis commands into a single batch db.query.text value. When stable database semantic conventions are emitted (stable or database/dup mode), the separator becomes "; " (semicolon plus space); old-only semconv mode keeps the existing compact ";" for db.statement. The change is applied consistently across the Jedis (2.0/3.0/4.0), Redisson, Lettuce 5.0, and Vert.x Redis javaagent instrumentations, with a small batchQuerySeparator() helper in each module and matching test expectations. Existing truncation limits are preserved because the separator length is factored into the limit checks.

Changes:

  • Introduce a semconv-aware batchQuerySeparator() helper in each Redis batch request class and use it when concatenating batch query text.
  • Preserve truncation behavior by counting the actual separator length against the batch text limit.
  • Update tests to expect "; " under stable semconv and ";" otherwise, including database/dup and large-batch truncation scenarios.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
jedis-2.0/.../JedisRequest.java Use batchQuerySeparator() in pipeline join; add helper and import.
jedis-2.0/.../JedisClientTest.java Expect semconv-dependent separator for pipeline/transaction scenarios.
jedis-3.0/.../JedisRequest.java Same separator helper change for Jedis 3.0.
jedis-3.0/.../Jedis30ClientTest.java Expect semconv-dependent separator.
jedis-4.0/.../JedisRequest.java Same separator helper change for Jedis 4.0.
jedis-4.0/.../Jedis40ClientTest.java Expect semconv-dependent separator.
lettuce-5.0/.../LettuceBatchRequest.java Use batchQuerySeparator() in query-text join; add helper and import.
lettuce-5.0/.../LettuceAsyncClientTest.java Expect semconv-dependent separator for deferred-flush scenarios.
redisson-common-3.0/.../RedissonRequest.java Join sanitized queries with batchQuerySeparator(); add helper.
redisson-common-3.0/.../AbstractRedissonClientTest.java Update batch/large/atomic expectations for separator.
redisson-common-3.0/.../AbstractRedissonAsyncClientTest.java Update atomic-batch expectation for separator.
vertx-redis-client-4.0/.../VertxRedisClientRequest.java Use batchQuerySeparator() and count its length against the limit.
vertx-redis-client-4.0/.../VertxRedisClientTest.java Update batch and large-truncation expectations for separator.

@trask
trask marked this pull request as ready for review July 9, 2026 19:13
@trask
trask requested a review from a team as a code owner July 9, 2026 19:13
@trask
trask marked this pull request as draft July 9, 2026 19:13
@trask
trask marked this pull request as ready for review July 9, 2026 19:23
…ry-separators

# Conflicts:
#	instrumentation/redisson/redisson-common-3.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonClientTest.java
#	instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/vertx/redisclient/v4_0/VertxRedisClientTest.java
@trask
trask enabled auto-merge (squash) July 10, 2026 15:12
@trask
trask merged commit fb528c9 into open-telemetry:main Jul 10, 2026
95 checks passed
@trask
trask deleted the fix-redis-batch-query-separators branch July 10, 2026 15:38
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