Repository navigation
Normalize Redis batch query separators - #19164
Conversation
5219853 to
1671c8e
Compare
1671c8e to
b2126ef
Compare
There was a problem hiding this comment.
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. |
…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
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.