jooby icon indicating copy to clipboard operation
jooby copied to clipboard

Support for Micrometer

Open re-thc opened this issue 3 years ago • 4 comments

Hi, most other libraries have moved onto Micrometer (from Dropwizard metrics) -- Spring, Quarkus, Micronaut, etc... Would be great if Jooby added support for Micrometer as a metrics option.

Thanks for considering!

re-thc avatar Dec 16 '20 14:12 re-thc

We had have it in 1.x. Would you like to submit a PR?

jknack avatar Dec 17 '20 00:12 jknack

How does the current metrics work? It's only for the web server? Or does it tie in with hibernate, hikari etc?

re-thc avatar Dec 20 '20 07:12 re-thc

Hikari module has the capability to register metrics' registries:

https://jooby.io/modules/metrics/

imeszaros avatar Dec 20 '20 12:12 imeszaros

I know this is an old post but I don't recommend Micrometer over Dropwizards Metrics or more so Open Telemetry or even raw Prometheus... or yes even JMX.

If one needs diagnostic/infrastructure metrics Open Telemetry is probably best. If one needs business metrics Dropwizard or rolling your own facade is good enough.

Micrometer bills itself as the SLF4j for metrics. You know a facade API but that is not the case at all. Its API jar is 675 kilobytes (both dropwizard metrics and even the complicated open telemetry are 1/6 the size). The reason it is that way is because they packaged the implementation (e.g. window sampling) AND the implementation of collecting metrics from other libraries ALL in one jar.

Furthermore Micrometer does not have healthchecks and forces a static singleton (I don't mind that for logging aka slf4j but I'm not sure I like the idea of every library depending on Micrometer).

Health checks are important k8s liveness and readiness probes. So by switching to micrometer you loose that.

agentgt avatar Sep 09 '22 17:09 agentgt