Skip to content

Align WebFlux and Ratpack client telemetry APIs for 3.0 - #20903

Open
trask with Copilot wants to merge 7 commits into
mainfrom
copilot/trask-webflux-client-server-api-changes
Open

trask with Copilot wants to merge 7 commits into
mainfrom
copilot/trask-webflux-client-server-api-changes

Conversation

Copilot AI commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Replace WebFlux client list-mutating helpers with filter factories and rename Ratpack's client instrumentation method to wrap(...), matching other library APIs. These are breaking API replacements for 3.0, without deprecated aliases.

// Before
builder.filters(telemetry::addFilter);
ratpackTelemetry.instrument(httpClient);

// After
builder.filter(telemetry.createFilter());
ratpackTelemetry.wrap(httpClient);

For Reactor context propagation, replace builder.filters(telemetry::addFilterAndRegisterReactorHook) with builder.filter(telemetry.createFilterAndRegisterReactorHook()).

Spring Boot customizers add the filter directly; the bean postprocessor still skips clients that already have one. Server filter APIs are unchanged.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-10-23 20:26 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

… API

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI changed the title [WIP] Update WebFlux client and server API for consistency Align WebFlux and Ratpack client telemetry APIs for 3.0 Oct 23, 2026
Copilot AI requested a review from trask October 23, 2026 16:35
@trask
trask requested a balanced review from Copilot October 23, 2026 16:36

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.

🟡 Changes recommended

Both Spring Boot customizers lose duplicate-filter detection and can append redundant tracing filters to already-instrumented builders.

1 open issue
What changed in this PR

Aligns WebFlux and Ratpack client instrumentation APIs for 3.0, replacing existing methods without deprecated aliases while leaving server APIs unchanged.

Changes:

  • Replaces WebFlux list-mutating helpers with filter factories and renames Ratpack’s client method to wrap(...).
  • Migrates starter integration, examples, and tests to the replacement APIs.
  • Adds filter-factory and post-processor coverage and documents the breaking changes.
File Description
instrumentation/​spring/​spring-webflux/​spring-webflux-5.3/​library/​src/​test/​java/​io/​opentelemetry/​instrumentation/​spring/​webflux/​v5_3/​SpringWebfluxClientTelemetryTest.java Tests filter factories and optional Reactor hook registration.
instrumentation/​spring/​spring-webflux/​spring-webflux-5.3/​library/​src/​test/​java/​io/​opentelemetry/​instrumentation/​spring/​webflux/​v5_3/​SpringWebfluxClientInstrumentationTest.java Uses the hook-registering filter factory.
instrumentation/​spring/​spring-webflux/​spring-webflux-5.3/​library/​src/​test/​java/​io/​opentelemetry/​instrumentation/​spring/​webflux/​v5_3/​SpringWebfluxClientHeaderSelectorTest.java Uses the filter factory in header tests.
instrumentation/​spring/​spring-webflux/​spring-webflux-5.3/​library/​src/​main/​java/​io/​opentelemetry/​instrumentation/​spring/​webflux/​v5_3/​SpringWebfluxClientTelemetry.java Replaces list-mutating helpers with filter factories.
instrumentation/​spring/​spring-webflux/​spring-webflux-5.3/​library/​README.md Updates WebFlux setup examples and hook guidance.
instrumentation/​spring/​spring-boot-autoconfigure/​src/​test/​java/​io/​opentelemetry/​instrumentation/​spring/​autoconfigure/​internal/​instrumentation/​webflux/​WebClientBeanPostProcessorTest.java Tests preservation of a manually installed tracing filter.
instrumentation/​spring/​spring-boot-autoconfigure/​src/​main/​javaSpring4/​io/​opentelemetry/​instrumentation/​spring/​autoconfigure/​internal/​instrumentation/​webflux/​SpringWebClientInstrumentationSpringBoot4AutoConfiguration.java Migrates the Boot 4 client customizer.
instrumentation/​spring/​spring-boot-autoconfigure/​src/​main/​java/​io/​opentelemetry/​instrumentation/​spring/​autoconfigure/​internal/​instrumentation/​webflux/​WebClientBeanPostProcessor.java Uses the factory within its existing presence check.
instrumentation/​spring/​spring-boot-autoconfigure/​src/​main/​java/​io/​opentelemetry/​instrumentation/​spring/​autoconfigure/​internal/​instrumentation/​webflux/​SpringWebfluxInstrumentationAutoConfiguration.java Migrates the Boot 2/3 client customizer.
instrumentation/​ratpack/​ratpack-1.7/​library/​src/​test/​java/​io/​opentelemetry/​instrumentation/​ratpack/​v1_7/​server/​OpenTelemetryModule.java Updates the client fixture to wrap(...).
instrumentation/​ratpack/​ratpack-1.7/​library/​src/​test/​java/​io/​opentelemetry/​instrumentation/​ratpack/​v1_7/​RatpackHttpClientTest.java Migrates HTTP client tests to wrap(...).
instrumentation/​ratpack/​ratpack-1.7/​library/​src/​test/​java/​io/​opentelemetry/​instrumentation/​ratpack/​v1_7/​client/​InstrumentedHttpClientTest.java Migrates client integration test setup.
instrumentation/​ratpack/​ratpack-1.7/​library/​src/​main/​java/​io/​opentelemetry/​instrumentation/​ratpack/​v1_7/​RatpackClientTelemetry.java Renames the client method and updates Javadoc.
instrumentation/​ratpack/​ratpack-1.7/​library/​README.md Updates the client wrapping example.
CHANGELOG.md Records both breaking API replacements.

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 23, 2026 16:52
@trask
trask requested a balanced review from Copilot October 23, 2026 16:58

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.

🟢 Approval recommended

The API migrations are consistent, and the shared starter guard preserves duplicate-filter detection with focused regression coverage.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 23, 2026 17:19
@trask
trask requested a balanced review from Copilot October 23, 2026 17:20

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.

🟢 Approval recommended

The API replacements, callers, documentation, and coverage are consistent, and the earlier duplicate-filter issue is confirmed resolved by the developer.

No open issues 🎉

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 23, 2026 18:09
@trask
trask requested a balanced review from Copilot October 23, 2026 18:11

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.

🔵 Needs a closer look

The new Reactor-hook test leaves a strategy registered globally after teardown, compromising test isolation.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Unregister the async-operation strategy installed by hook tests

instrumentation/​spring/​spring-webflux/​spring-webflux-5.3/​library/​src/​test/​java/​io/​opentelemetry/​instrumentation/​spring/​webflux/​v5_3/​SpringWebfluxClientTelemetryTest.java:25

[Testing] The registerHook=true case leaves its async-operation strategy in the global registry after teardown. createFilterAndRegisterReactorHook() creates an operator internally, but this reset creates a different operator with a different ReactorAsyncOperationEndStrategy. resetOnEachOperator() removes the global hooks but unregisters only its own strategy instance, so the registered strategy remains available to later tests through resolveStrategy(Mono.class) even with the hook disabled. Ensure cleanup unregisters the strategy installed by this test, without removing any pre-existing registration; alternatively, make the operator's reset unregister the actual hook owner’s strategy.

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 23, 2026 18:28
@trask
trask requested a balanced review from Copilot October 23, 2026 18:33

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.

🟢 Approval recommended

The API migration is consistent across callers and documentation, and the developer-confirmed follow-up resolves the previously reported duplicate-filter regression.

No open issues 🎉

Review effort: Balanced

Comment thread instrumentation/spring/spring-webflux/spring-webflux-5.3/library/build.gradle.kts Outdated
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 23, 2026 19:13
@trask
trask requested a balanced review from Copilot October 23, 2026 19:15

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.

🟢 Approval recommended

The API replacements are consistent across consumers and documentation, and the prior duplicate-filter concern is confirmed fixed with regression coverage.

No open issues 🎉

Review effort: Balanced

@trask
trask marked this pull request as ready for review October 23, 2026 19:38
@trask
trask requested a review from a team as a code owner October 23, 2026 19:38

This branch has not been deployed

No deployments
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