Class MetricsMixin
java.lang.Object
org.apache.juneau.rest.server.servlet.RestMixin
org.apache.juneau.rest.server.metrics.micrometer.MetricsMixin
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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.rest.server.servlet.RestMixin
RestMixin.Builder<R extends RestMixin,SELF extends RestMixin.Builder<R, SELF>>, RestMixin.DefaultBuilder<R extends RestMixin> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMetrics(RestRequest req) [GET /metrics] - Prometheus scrape of the consumer-provided MeterRegistry.Methods inherited from class org.apache.juneau.rest.server.servlet.RestMixin
builder, getHostContext, getRestBuilder, setContext
-
Constructor Details
-
MetricsMixin
public MetricsMixin()
-
-
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 scrapeableMeterRegistrybean is registered.
-