I have a Spring Boot 2.7.0 app. Actuator and webflux have the project versions as well(2.7.0). I create a WebClient bean using the WebClient.Builder. When I don't use a custom WebClientExchangeTagsProvider the metrics as exposed at the Prometheus. When I use a custom implementation that enhances the default one with an attribute, altought the custom TagProvider is called, the metric is not exposed.

@Configuration
public class ClientConfiguration {

    @Bean
    public WebClient webClient(WebClient.Builder webClientBuilder) {
        return webClientBuilder
                .baseUrl("https://example.org")
                .build();
    }
}

public class CustomWebClientExchangeTagsProvider implements WebClientExchangeTagsProvider {
    @Override
    public Iterable<Tag> tags(ClientRequest request, ClientResponse response, Throwable throwable) {
        return Tags.of("customTag1", request.attribute("a").map(String::valueOf).orElse("N/A"));
    }
}

@Configuration
public class WebClientConfig {

    @Bean
    public WebClientExchangeTagsProvider customWebClientExchangeTagsProvider() {
        return new CustomWebClientExchangeTagsProvider();
    }
}


@Service
@RequeredArgsConstructor
public class WebClientService {

   private final WebClient webClient;

    public Void<Mono> callWebClient() {
        return webClient
                      .attribute("a", "example")
                      ....
    }
}

Notes: 1. I am also using rest clients as well 2. The metric is shown in /acuator/metris/http.client.requests

Comment From: bclozel

Spring Boot 2.7x is out of open source support. See https://spring.io/projects/spring-boot/#support

We can reopen this issue if you manage to reproduce the problem with a supported version.

Thanks!