Middleware that applies per-route slow-transaction thresholds in Glowroot. More...
Classes | |
| class | Builder |
Public Member Functions | |
| HttpHandler | wrap (final HttpHandler next) |
Static Public Member Functions | |
| static Builder | builder () |
Returns a new Builder. | |
Middleware that applies per-route slow-transaction thresholds in Glowroot.
Different endpoints have different latency characteristics — a PDF export is naturally slower than an auth check. This middleware lets you specify distinct thresholds so Glowroot's slow-trace alerts are meaningful for every route, not just a single global value.
Route matching uses PathNormalizer so patterns with path variables (e.g. /users/:id) match any concrete URL like /users/550e8400-….
Build with the fluent Builder:
middlewareRegistry.add(GlowrootSlowThresholdMiddleware.builder().defaultThreshold(2_000) // 2 s for everything else
.threshold("/api/export/:id", 30_000) // 30 s for exports
.threshold("/api/auth/login", 500) // 500 ms for login
.build());
Definition at line 65 of file GlowrootSlowThresholdMiddleware.java.
|
static |
Returns a new Builder.
Definition at line 76 of file GlowrootSlowThresholdMiddleware.java.
| HttpHandler dev.rafex.ether.glowroot.jetty12.GlowrootSlowThresholdMiddleware.wrap | ( | final HttpHandler | next | ) |
Implements dev.rafex.ether.http.core.Middleware.
Definition at line 81 of file GlowrootSlowThresholdMiddleware.java.
References dev.rafex.ether.http.core.HttpHandler.handle().