Skip to content

Add R2DBC batch size semconv attributes#18980

Merged
laurit merged 5 commits into
open-telemetry:mainfrom
trask:r2dbc-batch-size-stable-semconv
Jun 15, 2026
Merged

Add R2DBC batch size semconv attributes#18980
laurit merged 5 commits into
open-telemetry:mainfrom
trask:r2dbc-batch-size-stable-semconv

Conversation

@trask

@trask trask commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve individual R2DBC batch query texts instead of joining them into one string
  • expose multi-query batch size to the shared SQL semconv extractor

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 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.

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

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

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

@trask trask marked this pull request as ready for review June 13, 2026 04:14
@trask trask requested a review from a team as a code owner June 13, 2026 04:14
@laurit laurit merged commit 5a47cc3 into open-telemetry:main Jun 15, 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