class ClientMain {

    static CompletionStage<Void> clientMetricsExample(String url, Config config) {
        //This part here is only for verification purposes, it is not needed to be done for actual usage.
        String counterName = "example.metric.GET.localhost";
        Counter counter = METRIC_REGISTRY.counter(counterName);
        System.out.println(counterName + ": " + counter.getCount());

        //Creates new metric which will count all GET requests and has format of example.metric.GET.<host-name>
        WebClientService clientService = WebClientMetrics.counter()
                .methods(Http.Method.GET)
                .nameFormat("example.metric.%1$s.%2$s")
                .build();

        //This newly created metric now needs to be registered to WebClient.
        WebClient webClient = WebClient.builder()
                .baseUri(url)
                .config(config)
                .addService(clientService)
                .build();

        //Perform any GET request using this newly created WebClient instance.
        return performGetMethod(webClient)
                //Verification for example purposes that metric has been incremented.
                .thenAccept(s -> System.out.println(counterName + ": " + counter.getCount()));
    }

    private  ClientMain();

}