java.lang.Object
org.apache.juneau.rest.server.servlet.RestMixin
org.apache.juneau.rest.server.metrics.micrometer.MetricsMixin

public class MetricsMixin extends RestMixin
Mixin flavor of the /metrics endpoint: renders a Prometheus scrape from a consumer-provided Micrometer MeterRegistry resolved from the host bean store.

Composes into a host resource via @Rest(mixins=MetricsMixin.class) and delegates to a shared MetricsManager worker. When no registry bean is present, or the registry is not a Prometheus registry, the endpoint degrades to HTTP 501 (Not Implemented) rather than failing — consistent with micrometer-core being provided and the registry choice being the consumer's.

See Also:
Since:
10.0.0
  • Constructor Details

  • Method Details

    • getMetrics

      [GET /metrics] - Prometheus scrape of the consumer-provided MeterRegistry.
      Parameters:
      req - The HTTP request.
      Returns:
      The Prometheus exposition text.
      Throws:
      NotImplemented - If no scrapeable MeterRegistry bean is registered.