1

I have a Histogram of values, very similar to how ASP.NET Core does it for their duration of HTTP requests. enter image description here My histogram is the following: reservations_api_processing_time. I have several key/value pairs in there, and I want to build a dashboard to show the processing time for each key. For example, in the above screenshot, I have two keys search_statistics="load-statistics-InHouse" and basic_search="first-page".

I tried several things, such as: sum by (le) (rate(reservations_api_processing_time_bucket{search_statistics="load-statistics-InHouse"}[30s])) Or reservations_api_processing_time_bucket{search_statistics="load-statistics-InHouse"} Or histogram_quantile(0.95, sum(rate(reservations_api_processing_time_bucket{search_statistics="load-statistics-InHouse"}[$__rate_interval])) by (le))

But neither really shows me the values as I want them to be seen.. I don't mind using Histogram or Heatmap as panel, either work for me, as long as I can see the actual processing time history.

My goal is to visualize the amount of time it took to process given a time period. For example, if I had 5 executions, and the processing time took [100, 200, 300, 400, 500] in ms, I want to be able to see all 5 executions as they are in my graph.

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
Dsmufsemfisajd
  • 99
  • 2
  • 10

1 Answers1

0

The following query should return 95th percentile of processing time for requests performed during the last hour (see 1h lookbehind window in square brackets), grouped by any additional labels other than le, which exist at reservations_api_processing_time histogram:

histogram_quantile(0.95, rate(reservations_api_processing_time_bucket[1h]))

See these docs for more details about Prometheus histograms

valyala
  • 11,669
  • 1
  • 59
  • 62