Another question about the MicrometerMetrics plugi...
# ktor
s
Another question about the MicrometerMetrics plugin. We are installing it into our ktor server (JVM based, NettyApplicationEngine, kotlin 1.8.21, ktor 2.3.0, coroutines 1.6.4). Yesterday our aws-otel-collector started flooding the syslog with warnings reporting that there was a problem collecting ktor_http_server_requests_seconds due to some missing le label. What's curious is the app and the otel collector haven't changed in weeks so we are digging in to why things started misbehaving as they did. We mitigated the syslog filling up the disk by adjusting the loglevel but I wanted to ask for suggestions on the recommended way to disable the collection of these ktor_http_* metrics in the event something goes awry like it did. Is it possible to interact with the installed plugin from within our ktor server based app to tell it to stop reporting metrics? I see that the uninstall and uninstallPlugin of ApplicationPlugin.kt are both deprecated. I also see I can get the plugin for this MicrometerMetrics key but have struggled to type this from PluginInstance to anything I can unset the meterBinders or make it stop. Any suggestions would be greatly appreciated.
m
I guess, you are looking for a feature similar dynamic log reconfiguration offered by log4j2. If the plug-in uses log back or log4j as the underlying logging implementation, then it should be possible. Probably worth skimming through the plugin source code
s
I was going to do that today. Thanks for the suggestion. I'd love to be able to solve it in the Kotlin code but I will do some research and reading up.