Search in sources :

Example 1 with MeterFilter

use of io.micrometer.api.instrument.config.MeterFilter in project reactor-netty by reactor.

the class Application method main.

public static void main(String[] args) {
    // <1>
    Metrics.globalRegistry.config().meterFilter(MeterFilter.maximumAllowableTags("reactor.netty.http.server", "URI", 100, MeterFilter.deny()));
    DisposableServer server = HttpServer.create().metrics(true, s -> {
        if (s.startsWith("/stream/")) {
            // <2>
            return "/stream/{n}";
        } else if (s.startsWith("/bytes/")) {
            return "/bytes/{n}";
        }
        return s;
    }).route(r -> r.get("/stream/{n}", (req, res) -> res.sendString(Mono.just(req.param("n")))).get("/bytes/{n}", (req, res) -> res.sendString(Mono.just(req.param("n"))))).bindNow();
    server.onDispose().block();
}
Also used : HttpServer(reactor.netty.http.server.HttpServer) MeterFilter(io.micrometer.api.instrument.config.MeterFilter) Metrics(io.micrometer.api.instrument.Metrics) Mono(reactor.core.publisher.Mono) DisposableServer(reactor.netty.DisposableServer) DisposableServer(reactor.netty.DisposableServer)

Aggregations

Metrics (io.micrometer.api.instrument.Metrics)1 MeterFilter (io.micrometer.api.instrument.config.MeterFilter)1 Mono (reactor.core.publisher.Mono)1 DisposableServer (reactor.netty.DisposableServer)1 HttpServer (reactor.netty.http.server.HttpServer)1