Class MetricsPrometheusHandler

  • All Implemented Interfaces:
    Handler

    public class MetricsPrometheusHandler
    extends java.lang.Object
    implements Handler
    A Handler that exposes metric reports in Prometheus format.

    This handler should be bound to an application path, and most likely only for the GET method…

     import ratpack.dropwizard.metrics.MetricsPrometheusHandler;
     import static org.junit.Assert.*;
    
     assertTrue(chain instanceof ratpack.handling.Chain);
     chain.get("admin/metrics", new MetricsPrometheusHandler());
     
    Since:
    1.6
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handle​(Context ctx)
      Handles the context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MetricsPrometheusHandler

        public MetricsPrometheusHandler()
    • Method Detail

      • handle

        public void handle​(Context ctx)
                    throws java.lang.Exception
        Description copied from interface: Handler
        Handles the context.
        Specified by:
        handle in interface Handler
        Parameters:
        ctx - The context to handle
        Throws:
        java.lang.Exception - if anything goes wrong (exception will be implicitly passed to the context's Context.error(Throwable) method)