MetricsService
class MetricsService(port: Int, path: String, initBlock: MetricsService.() -> Unit = {}) : GenericIdleService
A Guava GenericIdleService that runs an embedded Jetty server to expose a Prometheus MetricsServlet.
The service starts a Jetty HTTP server on the specified port and serves the Prometheus metrics endpoint at the given path. It also exposes a healthCheck property for integration with Dropwizard health check registries.
Parameters
port
The HTTP port for the metrics endpoint.
path
The URL path for the Prometheus metrics servlet (without a leading slash).
initBlock
An optional initialization block invoked after the service listener is registered.