🎉 Add jetty metrics.

This commit is contained in:
Andrey Antukh 2021-01-19 14:45:49 +01:00 committed by Alonso Torres
parent d8ee07d1e4
commit 34e5e5c513
4 changed files with 38 additions and 16 deletions

View file

@ -24,6 +24,8 @@
io.prometheus.client.Summary
io.prometheus.client.exporter.common.TextFormat
io.prometheus.client.hotspot.DefaultExports
io.prometheus.client.jetty.JettyStatisticsCollector
org.eclipse.jetty.server.handler.StatisticsHandler
java.io.StringWriter))
(declare instrument-vars!)
@ -228,3 +230,10 @@
:else
(ex/raise :type :not-implemented))))
(defn instrument-jetty!
[^CollectorRegistry registry ^StatisticsHandler handler]
(doto (JettyStatisticsCollector. handler)
(.register registry))
nil)