Skip to content

Commit

Permalink
Update docs and one more rename
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Dec 11, 2024
1 parent 4e2bc5b commit e3fd190
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ private WebClient.Builder wrapBuilder(WebClient.Builder webClientBuilder) {
SpringWebfluxClientTelemetry instrumentation =
getWebfluxClientTelemetry(
openTelemetryProvider.getObject(), configPropertiesProvider.getObject());
return webClientBuilder.filters(instrumentation::addTracingFilter);
return webClientBuilder.filters(instrumentation::addFilter);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ For this instrumentation, the minimum supported version of Spring Webflux is 5.3
For Maven, add to your `pom.xml`:

```xml

<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
Expand Down Expand Up @@ -59,23 +60,24 @@ import io.opentelemetry.instrumentation.spring.webflux.v5_3.SpringWebfluxTelemet

@Configuration
public class WebClientConfig {
private final SpringWebfluxTelemetry webfluxTelemetry;
private final SpringWebfluxClientTelemetry webfluxClientTelemetry;
private final SpringWebfluxServerTelemetry webfluxServerTelemetry;

public WebClientConfig(OpenTelemetry openTelemetry) {
this.webfluxTelemetry = SpringWebfluxTelemetry.builder(openTelemetry).build();
this.webfluxClientTelemetry = SpringWebfluxClientTelemetry.builder(openTelemetry).build();
}

// Adds instrumentation to WebClients
@Bean
public WebClient.Builder webClient() {
WebClient webClient = WebClient.create();
return webClient.mutate().filters(webfluxTelemetry::addClientTracingFilter);
return webClient.mutate().filters(webfluxClientTelemetry::addFilter);
}

// Adds instrumentation to Webflux server
@Bean
public WebFilter webFilter() {
return webfluxTelemetry.createWebFilterAndRegisterReactorHook();
return webfluxServerTelemetry.createWebFilterAndRegisterReactorHook();
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static SpringWebfluxClientTelemetryBuilder builder(OpenTelemetry openTele
this.propagators = propagators;
}

public void addTracingFilter(List<ExchangeFilterFunction> exchangeFilterFunctions) {
public void addFilter(List<ExchangeFilterFunction> exchangeFilterFunctions) {
for (ExchangeFilterFunction filterFunction : exchangeFilterFunctions) {
if (filterFunction instanceof WebClientTracingFilter) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static SpringWebfluxTelemetryBuilder builder(OpenTelemetry openTelemetry)
}

/**
* @deprecated Use {@link SpringWebfluxClientTelemetry#addTracingFilter(List)} instead.
* @deprecated Use {@link SpringWebfluxClientTelemetry#addFilter(List)} instead.
*/
@Deprecated
public void addClientTracingFilter(List<ExchangeFilterFunction> exchangeFilterFunctions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ protected WebClient.Builder instrument(WebClient.Builder builder) {
.setCapturedResponseHeaders(
Collections.singletonList(AbstractHttpClientTest.TEST_RESPONSE_HEADER))
.build();
return builder.filters(instrumentation::addTracingFilter);
return builder.filters(instrumentation::addFilter);
}
}

0 comments on commit e3fd190

Please sign in to comment.