grobid icon indicating copy to clipboard operation
grobid copied to clipboard

Dropwizard metrics and Prometheus collected metrics have different metrics name conventions

Open kermitt2 opened this issue 2 years ago • 0 comments

Dropwizard and Prometheus use different convention for naming metrics. We use Dropwizard as REST API framework and Prometheus Java Suite collects the Dropwizard metrics for producing http://localhost:8071/metrics/prometheus but it is not converting the metrics names.

Then Promethus complains:

lopez@work:~/dataset_recognition_resources$ curl -s http://localhost:8071/metrics/prometheus | promtool check metrics
io_dropwizard_jetty_MutableServletContextHandler_1xx_responses_total metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_2xx_responses_total metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_3xx_responses_total metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_4xx_responses_total metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_5xx_responses_total metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_active_dispatches metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_active_requests metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_active_suspended metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_async_dispatches_total metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_async_timeouts_total metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_connect_requests metric names should be written in 'snake_case' not 'camelCase'
io_dropwizard_jetty_MutableServletContextHandler_delete_requests metric names should be written in 'snake_case' not 'camelCase'
jvm_buffers_direct_count non-histogram and non-summary metrics should not have "_count" suffix
jvm_buffers_mapped_count non-histogram and non-summary metrics should not have "_count" suffix
jvm_gc_PS_MarkSweep_count metric names should be written in 'snake_case' not 'camelCase'
jvm_gc_PS_MarkSweep_count non-histogram and non-summary metrics should not have "_count" suffix
jvm_gc_PS_MarkSweep_time metric names should be written in 'snake_case' not 'camelCase'
jvm_gc_PS_Scavenge_count non-histogram and non-summary metrics should not have "_count" suffix
jvm_threads_blocked_count non-histogram and non-summary metrics should not have "_count" suffix

This might create problems for visualization and alerting using Prometheus.

Maybe we could use https://github.com/Sansofts/dropwizard-prometheus

For reference: https://prometheus.io/docs/instrumenting/writing_exporters/#naming https://github.com/micrometer-metrics/micrometer/issues/80#issuecomment-321125165

kermitt2 avatar Jun 01 '22 05:06 kermitt2