log-format = - - %(user) [%(ltime)] "%(method) %(uri) %(proto)" %(status) %(size) "%(referer)" "%(uagent)" [%(msecs)]prom_timings = Histogram('response_time', 'handlers time response', ['handle'])
....
....
....
for url, tm in counters.iteritems():
for time in list(tm.elements()):
prom_timings.labels(url).observe(float(time) )sum(rate(response_time_bucket{project="news", handle="$handle"}[$interval])) /sum(rate(response_time_count{project="news", handle="$handle"}[$interval]))response_time_bucket{handle="/regions/info/",le="0.005"} 0.0
response_time_bucket{handle="/regions/info/",le="0.01"} 17.0
response_time_bucket{handle="/regions/info/",le="0.025"} 36.0
response_time_bucket{handle="/regions/info/",le="0.05"} 36.0
response_time_bucket{handle="/regions/info/",le="0.075"} 36.0
response_time_bucket{handle="/regions/info/",le="0.1"} 36.0
response_time_bucket{handle="/regions/info/",le="0.25"} 36.0
response_time_bucket{handle="/regions/info/",le="0.5"} 36.0
response_time_bucket{handle="/regions/info/",le="0.75"} 36.0
response_time_bucket{handle="/regions/info/",le="1.0"} 36.0
response_time_bucket{handle="/regions/info/",le="2.5"} 36.0
response_time_bucket{handle="/regions/info/",le="5.0"} 36.0
response_time_bucket{handle="/regions/info/",le="7.5"} 36.0
response_time_bucket{handle="/regions/info/",le="10.0"} 36.0
response_time_bucket{handle="/regions/info/",le="+Inf"} 36.0
response_time_count{handle="/regions/info/"} 36.0
response_time_sum{handle="/regions/info/"} 0.40200000000000025
prom_timings.labels(url).observe(float(time) / 1000 )
--
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 prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/b34e6eca-26f5-4ad1-af08-4d46dc2bfef7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
sum(rate(response_time_sum{project="news", handle!~".*admin.*|.*version.*|.*robots.*"}[$interval])) by (handle)
/
sum(rate(response_time_count{project="news", handle!~".*admin.*|.*version.*|.*robots.*"}[$interval])) by (handle) sum(rate(http_request_duration_seconds_bucket{le="0.3"}[5m])) by (job)
/
sum(rate(http_request_duration_seconds_count[5m])) by (job)
You can approximate the well-known Apdex score in a similar way. Configure a bucket with the target request duration as the upper bound and another bucket with the tolerated request duration (usually 4 times the target request duration) as the upper bound. Example: The target request duration is 300ms
response_time_bucket{handle="/v1/clusters/topic/all/",le="0.005"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="0.01"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="0.025"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="0.05"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="0.075"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="0.1"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="0.25"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="0.5"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="0.75"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="1.0"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="2.5"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="5.0"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="7.5"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="10.0"} 0.0
response_time_bucket{handle="/v1/clusters/topic/all/",le="+Inf"} 1031.0

histogram_quantile(0.99, sum(rate(response_time_bucket{handle="/regions/info/"}[1m])) by (le))sum(rate(response_time_bucket{project="news", handle="/regions/info/"}[1m])) by (le)