eclipse / microprofile-metrics

microprofile-metrics
Apache License 2.0
100 stars 66 forks source link

SPEC: add section on how to format Prometheus output for Micrometer impls #672

Closed donbourne closed 1 year ago

donbourne commented 2 years ago

To enhance consistency between MP Metrics implementations based on Micrometer, we should add a section to the spec detailing how prometheus-formatted output should look for each of the Metric types

Histograms

# TYPE metricHistogram_bytes_max gauge
# HELP metricHistogram_bytes_max  
metricHistogram_bytes_max{scope="application"} 1000.0
# TYPE metricHistogram_bytes summary
# HELP metricHistogram_bytes  
metricHistogram_bytes{scope="application",quantile="0.5"} 1000.0
metricHistogram_bytes{scope="application",quantile="0.75"} 1000.0
metricHistogram_bytes{scope="application",quantile="0.95"} 1000.0
metricHistogram_bytes{scope="application",quantile="0.98"} 1000.0
metricHistogram_bytes{scope="application",quantile="0.99"} 1000.0
metricHistogram_bytes{scope="application",quantile="0.999"} 1000.0
metricHistogram_bytes_count{scope="application"} 1.0
metricHistogram_bytes_sum{scope="application"} 1000.0

Timers

# TYPE metricTimer_seconds summary
# HELP metricTimer_seconds  
metricTimer_seconds{scope="application",quantile="0.5"} 1.946157056
metricTimer_seconds{scope="application",quantile="0.75"} 1.946157056
metricTimer_seconds{scope="application",quantile="0.95"} 1.946157056
metricTimer_seconds{scope="application",quantile="0.98"} 1.946157056
metricTimer_seconds{scope="application",quantile="0.99"} 1.946157056
metricTimer_seconds{scope="application",quantile="0.999"} 1.946157056
metricTimer_seconds_count{scope="application"} 1.0
metricTimer_seconds_sum{scope="application"} 2.0071254
# TYPE metricTimer_seconds_max gauge
# HELP metricTimer_seconds_max  
metricTimer_seconds_max{scope="application"} 2.0071254
donbourne commented 1 year ago

I updated the REST endpoint section in #690 to leave the Prometheus/OpenMetrics formatting details to the Prometheus/OpenMetrics docs/specs. Given that, I don't think we need a separate section on formatting for Micrometer impls. If we choose to, we can still add TCK tests that are implementation-specific, as part of #669 .