How to export Spring Boot `http.server.requests` as Prometheus Histogram

701 views
Skip to first unread message

Rafael Dohms

unread,
Jan 31, 2020, 8:17:08 AM1/31/20
to Prometheus Users

I have a Spring Boot setup, with micrometer and metrics turned on.
I have successfully used http.server.requests to export a Counter of how many requests are happening.


However, I'm now stuck trying to create a Histogram of response times for these same requests.


What I have tried so far:

  • Tried to find a way to extract the Attributes as a Prometheus Histogram, but found no way to do this
  • Set management.metrics.distribution.sla.http.server.requests: 1ms, 2ms, 5ms, 10ms, 20ms, 30ms to get a set of gauges that represent the buckets

Has anyone achieved this before? I'm currently thinking along the lines of recreating the _sum, _count and _bucket parts separately from the gauge but I have not yet figured out how to do the sum and count parts. Any direction is much appreciated.

Rafael Dohms

unread,
Jan 31, 2020, 8:19:03 AM1/31/20
to Prometheus Users
Sorry, this is now missing the proper context.

I'm looking for the correct jmx_exporter configuration to achieve this.

kanu batra

unread,
Mar 17, 2020, 4:37:27 AM3/17/20
to Prometheus Users
Hi Rafael,
I am also facing a similar issue while exporting kafka connect metrics in histogram types.
Did you find a solution to this?

Maximilian Ressel

unread,
Jul 17, 2020, 3:48:16 PM7/17/20
to Prometheus Users
Found this: 
management.metrics.web.server.request.autotime.percentiles-histogram=true

Hope it helps.
Reply all
Reply to author
Forward
0 new messages