Class MetricsRequestHandler


  • @ApplicationScoped
    public class MetricsRequestHandler
    extends Object
    Author:
    Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
    Date: 6/25/18
    • Constructor Detail

      • MetricsRequestHandler

        public MetricsRequestHandler()
    • Method Detail

      • appendCorsHeaders

        public void appendCorsHeaders​(boolean value)
      • handleRequest

        public void handleRequest​(String requestPath,
                                  String method,
                                  Stream<String> acceptHeaders,
                                  MetricsRequestHandler.Responder responder)
                           throws IOException
        Parameters:
        requestPath - e.g. request.getRequestURI for an HttpServlet
        method - http method (GET, POST, etc)
        acceptHeaders - accepted content types
        responder - a method that returns a response to the caller. See MetricsRequestHandler.Responder
        Throws:
        IOException - rethrows IOException if thrown by the responder You can find example usage in the tests, in io.smallrye.metrics.tck.rest.MetricsHttpServlet
      • handleRequest

        public void handleRequest​(String requestPath,
                                  String contextRoot,
                                  String method,
                                  Stream<String> acceptHeaders,
                                  MetricsRequestHandler.Responder responder)
                           throws IOException
        Parameters:
        requestPath - e.g. request.getRequestURI for an HttpServlet
        contextRoot - the root at which Metrics are exposed, usually "/metrics"
        method - http method (GET, POST, etc)
        acceptHeaders - accepted content types
        responder - a method that returns a response to the caller. See MetricsRequestHandler.Responder
        Throws:
        IOException - rethrows IOException if thrown by the responder You can find example usage in the tests, in io.smallrye.metrics.tck.rest.MetricsHttpServlet