@ApplicationScoped public class MetricsRequestHandler extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
MetricsRequestHandler.Responder
Responder is used by MetricsRequestHandler to return a response to the caller
|
| Constructor and Description |
|---|
MetricsRequestHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
appendCorsHeaders(boolean value) |
void |
handleRequest(String requestPath,
String method,
Stream<String> acceptHeaders,
MetricsRequestHandler.Responder responder) |
void |
handleRequest(String requestPath,
String contextRoot,
String method,
Stream<String> acceptHeaders,
MetricsRequestHandler.Responder responder) |
public void appendCorsHeaders(boolean value)
public void handleRequest(String requestPath, String method, Stream<String> acceptHeaders, MetricsRequestHandler.Responder responder) throws IOException
requestPath - e.g. request.getRequestURI for an HttpServletmethod - http method (GET, POST, etc)acceptHeaders - accepted content typesresponder - a method that returns a response to the caller. See MetricsRequestHandler.ResponderIOException - rethrows IOException if thrown by the responder
You can find example usage in the tests, in io.smallrye.metrics.tck.rest.MetricsHttpServletpublic void handleRequest(String requestPath, String contextRoot, String method, Stream<String> acceptHeaders, MetricsRequestHandler.Responder responder) throws IOException
requestPath - e.g. request.getRequestURI for an HttpServletcontextRoot - the root at which Metrics are exposed, usually "/metrics"method - http method (GET, POST, etc)acceptHeaders - accepted content typesresponder - a method that returns a response to the caller. See MetricsRequestHandler.ResponderIOException - rethrows IOException if thrown by the responder
You can find example usage in the tests, in io.smallrye.metrics.tck.rest.MetricsHttpServletCopyright © 2018–2021. All rights reserved.