Package org.apache.juneau.rest.server.metrics


package org.apache.juneau.rest.server.metrics
Metrics SPI for juneau-rest-server — per-request observability hook backed by a caller-supplied MetricsRecorder bean.
Opt-in

The SPI is off by default. A fresh RestContext built without any @Bean MetricsRecorder entry uses NoOpMetricsRecorder — no downstream registry is touched, no per-request allocation is made. Consumers opt in by supplying a bridge implementation:

  • juneau-rest-server-metrics-micrometer ships MicrometerMetricsRecorder backed by an io.micrometer.core.instrument.MeterRegistry.
  • Custom backends (Dropwizard MetricRegistry, application-specific stat counters, etc.) can implement MetricsRecorder directly — the SPI intentionally has no Micrometer / OpenTelemetry dependency on the core surface.
Event shape

Every @RestOp invocation fires exactly one record(...) call — happy path and exception path alike. The event carries the op name, the HTTP method, the @RestOp path template (so consumers can use it as a bounded-cardinality uri tag), the response status code, the wall-clock elapsed time, and the thrown Throwable (or null on success).

See Also:
Since:
10.0.0