problem: unclear when monitoring is enabled and how to access it

This commit is contained in:
Igor Artamonov
2021-02-06 22:39:17 -05:00
parent 6f138e1ac7
commit 3df27bee5d

View File

@@ -57,6 +57,7 @@ class MonitoringSetup(
// use standard JVM server with a single thread blocking processing
// prometheus is a single thread periodic call, no reason to setup anything complex
try {
log.info("Run Prometheus metrics on ${monitoringConfig.prometheus.host}:${monitoringConfig.prometheus.port}${monitoringConfig.prometheus.path}")
val server = HttpServer.create(InetSocketAddress(monitoringConfig.prometheus.host, monitoringConfig.prometheus.port), 0);
server.createContext(monitoringConfig.prometheus.path) { httpExchange ->
val response = prometheusRegistry.scrape()