Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current observation not in scope during WebClient ExchangeFilterFunction execution #33559

Closed
bclozel opened this issue Sep 18, 2024 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) theme: observability An issue related to observability and tracing type: bug A general bug
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Sep 18, 2024

This was discussed with @chemicL in micrometer-metrics/micrometer#5472

Currently, DefaultWebClient executes ExchangeFilterFunction as the reactive pipeline is assembled during subscription. This means that if imperative code is executed in a filter function, it won't be aware of the current observation through the local scope.

For example, when automatic context propagation is enabled for Reactor operators, the logger MDC will not know about the current traceId/spanId.

ExchangeFilterFunction assertionFilter = (request, chain) -> {
  logger.info("This log will not contain the traceId information");
  return chain.exchange(request);
};

We should defer the execution of filter functions to fix that limitation.

@bclozel bclozel added in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug theme: observability An issue related to observability and tracing labels Sep 18, 2024
@bclozel bclozel added this to the 6.1.14 milestone Sep 18, 2024
@bclozel bclozel self-assigned this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) theme: observability An issue related to observability and tracing type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant