Package org.forgerock.monitoring.http
Class PrometheusHandler
- java.lang.Object
-
- org.forgerock.monitoring.http.PrometheusHandler
-
- All Implemented Interfaces:
org.forgerock.http.Handler
public final class PrometheusHandler extends Object implements org.forgerock.http.Handler
An HTTPHandler
from which Prometheus can scrap monitoring information.
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>
SUPPORTED_HTTP_METHODS
List of HTTP methods supported by a Prometheus Handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Promise<org.forgerock.http.protocol.Response,NeverThrowsException>
handle(org.forgerock.services.context.Context context, org.forgerock.http.protocol.Request request)
static PrometheusHandler
prometheusHandler(String metricPrefix, Supplier<MeterRegistry> meterRegistrySupplier)
Returns a new Prometheus Handler.
-
-
-
Method Detail
-
prometheusHandler
public static PrometheusHandler prometheusHandler(String metricPrefix, Supplier<MeterRegistry> meterRegistrySupplier)
Returns a new Prometheus Handler.- Parameters:
metricPrefix
- The prefix that will be prepended before each metrics. Ideally this will be the product specific prefix.meterRegistrySupplier
- ASupplier
of theMetricRegistry
which will be used to collect metrics to include in HTTP response sent by thisPrometheusHandler
.- Returns:
- a new
PrometheusHandler
-
handle
public Promise<org.forgerock.http.protocol.Response,NeverThrowsException> handle(org.forgerock.services.context.Context context, org.forgerock.http.protocol.Request request)
- Specified by:
handle
in interfaceorg.forgerock.http.Handler
-
-