server.meterRegistry(meterRegistry);
server.meterRegistry(meterRegistry);
@Override protected void configure(ServerBuilder sb) throws Exception { sb.meterRegistry(registry); sb.service("/helloservice", THttpService.of((Iface) name -> { if ("world".equals(name)) { return "success"; } throw new IllegalArgumentException("bad argument"); }).decorate(MetricCollectingService.newDecorator( MeterIdPrefixFunction.ofDefault("armeria.server.HelloService")))); } };
@Override protected void configure(ServerBuilder sb) throws Exception { sb.meterRegistry(registry); final THttpService helloService = THttpService.of((Iface) name -> { if ("world".equals(name)) { return "success"; } throw new IllegalArgumentException("bad argument"); }); sb.service("/foo", helloService.decorate( MetricCollectingService.newDecorator(new MeterIdPrefixFunctionImpl("server", "Foo")))); sb.service("/bar", helloService.decorate( MetricCollectingService.newDecorator(new MeterIdPrefixFunctionImpl("server", "Bar")))); sb.service("/internal/prometheus/metrics", new PrometheusExpositionService(prometheusRegistry)); } };
@Override protected void configure(ServerBuilder sb) throws Exception { sb.meterRegistry(registry); sb.serviceUnder("/", new GrpcServiceBuilder() .addService(new TestServiceImpl()) .enableUnframedRequests(true) .build() .decorate(MetricCollectingService.newDecorator( MeterIdPrefixFunction.ofDefault("server")))); } };
final ServerBuilder serverBuilder = new ServerBuilder().meterRegistry(meterRegistry()) .workerGroup(eventLoop(), false) .service(path(), service);