Class PrometheusHandler

  • All Implemented Interfaces:
    org.forgerock.http.Handler

    public final class PrometheusHandler
    extends Object
    implements org.forgerock.http.Handler
    An HTTP Handler from which Prometheus can scrap monitoring information.
    • Field Detail

      • SUPPORTED_HTTP_METHODS

        public static final List<String> SUPPORTED_HTTP_METHODS
        List of HTTP methods supported by a 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 - A Supplier of the MetricRegistry which will be used to collect metrics to include in HTTP response sent by this PrometheusHandler.
        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 interface org.forgerock.http.Handler