Add content-type to metrics (#618)

This commit is contained in:
KirillPamPam
2025-01-09 14:36:38 +04:00
committed by GitHub
parent 15ffdc2d2e
commit 22334ffbb9

View File

@@ -87,6 +87,7 @@ class MonitoringSetup(
server.createContext(monitoringConfig.prometheus.path) { httpExchange ->
val response = prometheusRegistry.scrape()
httpExchange.responseHeaders.add("Content-Encoding", "gzip")
httpExchange.responseHeaders.add("Content-Type", "text/plain")
httpExchange.sendResponseHeaders(200, 0)
httpExchange.responseBody.use { os ->
GZIPOutputStream(os).use { gzos ->