Class MetricCollectingService

All Implemented Interfaces:
Unwrappable, HttpService, Service<HttpRequest,​HttpResponse>

public final class MetricCollectingService
extends SimpleDecoratingHttpService
Decorates an HttpService to collect metrics into MeterRegistry.

Example:


 serverBuilder.service(
         "/service",
         THttpService.of(handler)
                     .decorate(MetricCollectingService.newDecorator(
                             MeterIdPrefixFunction.ofDefault("myService"))));
 
 

It is generally recommended not to use a class or package name as a metric name, because otherwise seemingly harmless refactoring such as rename may break metric collection.