Module net.morimekta.tiny.server
Package net.morimekta.tiny.server.http
Class TinyPrometheusHttpHandler
- java.lang.Object
-
- net.morimekta.tiny.server.http.TinyHttpHandler
-
- net.morimekta.tiny.server.http.TinyPrometheusHttpHandler
-
- All Implemented Interfaces:
HttpHandler
public final class TinyPrometheusHttpHandler extends TinyHttpHandler
Simple HTTP handler for getting prometheus metrics.
-
-
Constructor Summary
Constructors Constructor Description TinyPrometheusHttpHandler()Instantiate handler with default registry.TinyPrometheusHttpHandler(io.prometheus.client.CollectorRegistry registry)Instantiate handler with specified registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoGet(HttpExchange exchange)Handle a GET request.
-
-
-
Constructor Detail
-
TinyPrometheusHttpHandler
public TinyPrometheusHttpHandler()
Instantiate handler with default registry.
-
TinyPrometheusHttpHandler
public TinyPrometheusHttpHandler(io.prometheus.client.CollectorRegistry registry)
Instantiate handler with specified registry.- Parameters:
registry- The prometheus collector registry.
-
-
Method Detail
-
doGet
protected void doGet(HttpExchange exchange) throws IOException
Description copied from class:TinyHttpHandlerHandle a GET request.- Overrides:
doGetin classTinyHttpHandler- Parameters:
exchange- The HTTP exchange.- Throws:
IOException- If failed to handle the request.
-
-