Add R2DBC batch size semconv attributes#18980
Merged
laurit merged 5 commits intoJun 15, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the R2DBC 1.0 instrumentation to better represent batch executions in database semantic conventions by keeping per-entry query texts, surfacing batch size to the shared SQL semconv extractor, and adding stable semconv test coverage for batch queries.
Changes:
- Preserve individual batch query texts (instead of pre-joining them) so the shared SQL semconv logic can reason about multi-query batches.
- Expose batch size via the R2DBC SQL attributes getter (mapping R2DBC batch size into
db.operation.batch_size). - Add/extend unit + integration tests to validate stable semconv behavior for batch queries.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| instrumentation/r2dbc-1.0/testing/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/AbstractR2dbcStatementTest.java | Adds an integration test asserting stable semconv attributes for R2DBC batch queries, including batch size. |
| instrumentation/r2dbc-1.0/library/src/test/java/io/opentelemetry/instrumentation/r2dbc/v1_0/DbExecutionTest.java | Updates unit tests for the new “multiple raw query texts” model and validates batch size handling. |
| instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/internal/R2dbcSqlAttributesGetter.java | Wires R2DBC execution data into the shared SQL semconv extractor, including batch size and raw query texts. |
| instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/internal/DbExecution.java | Changes internal execution representation to store multiple raw query texts and compute a nullable batch size. |
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