Hi, I have added metrics to an application like th...
# ktor
a
Hi, I have added metrics to an application like this:
Copy code
install(MicrometerMetrics) {
        registry = DatadogMeterRegistry(config, Clock.SYSTEM)
        ...
    }
Would it be possible to access and reuse the same registry for adding custom metrics in handlers? Thanks!
d
you need to instantiate the MeterRegistry outside the
install
statement and assign it
Copy code
val registry = DatadogMeterRegistry(config, Clock.SYSTEM)
install(MicrometerMetrics) {
        registry = registry
        ...
    }
// use it in a route
a
Thanks @David Hernando!
🤟 1