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
-
Method Summary
Modifier and TypeMethodDescriptionstatic HTTPServer.Builder
builder()
static HTTPServer.Builder
builder
(PrometheusProperties config) void
close()
Stop the HTTPServer.int
getPort()
Gets the port number.void
stop()
Stop the HTTP server.
-
Method Details
-
stop
Stop the HTTP server. Same asclose()
. -
close
Stop the HTTPServer. Same asstop()
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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
-