Class HTTPServer
Object
HTTPServer
- All Implemented Interfaces:
Closeable,AutoCloseable
Expose Prometheus metrics using a plain Java HttpServer.
Example Usage:
HTTPServer server = HTTPServer.builder()
.port(9090)
.buildAndStart();
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic HTTPServer.Builderbuilder()static HTTPServer.Builderbuilder(PrometheusProperties config) voidclose()Stop the HTTPServer.intgetPort()Gets the port number.voidstop()Stop the HTTP server.
-
Method Details
-
stop
Stop the HTTP server. Same asclose(). -
close
Stop the HTTPServer. Same asstop().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getPort
Gets the port number. This is useful if you did not specify a port and the server picked a free port automatically. -
builder
-
builder
-