We are migrating telemetry backend from legacy database to Prometheus and 
require estimating percentiles on gauge metrics published by user 
applications. Estimating percentiles on a gauge metric in Prometheus is not 
feasible and for a number of reasons, client applications will be difficult 
to modify to start publishing histograms. 

I am exploring feasibility of creating a histogram in a recording rule in 
Prometheus based on the metrics published by users. The partial work put in 
so far seems inefficient, also illegible. Is there a recommended approach 
to solve this problem? As stated earlier, it will be extremely hard to 
solve the problem on the client side and I am looking for a solution within 
Prometheus.

*Current metric is a gauge with with values representing request latency.*
http_duration_milliseconds_gauge{instance="instance1:port1"}[1h]
1659752188  100
1659752068  120
..
1659751708   150
1659751588    160

*Desired histogram after conversion -*
http_duration_milliseconds_hist_bucket{instance="instance1:port1", le=100}  
133
http_duration_milliseconds_hist_bucket{instance="instance1:port1", le=120}  
222
http_duration_milliseconds_hist_bucket{instance="instance1:port1", le=140}  
311
http_duration_milliseconds_hist_bucket{instance="instance1:port1", le=160}  
330
http_duration_milliseconds_hist_bucket{instance="instance1:port1", le=180}  
339
http_duration_milliseconds_hist_bucket{instance="instance1:port1", le=200}  
340







-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/f95b5512-1c81-4e12-9670-7c7eb0d29f5en%40googlegroups.com.

Reply via email to