Measure service latency with prometheus

ぃ、小莉子 提交于 2019-12-01 21:28:42

问题


I am new to prometheus and grafana...

My primary goal is to get the response time per request.

For me it seemed to be a simple thing - but whatever I do I do not get the results I require.

I need to be able to analyse the service lateny in the last minutes/hours/days. The current implementation I found was a simple SUMMARY (without definition of quantiles) which is scraped every 15s.

  1. Is it possible to get the average request latency of the last minute from my prometheus SUMMARY?
  2. If YES: How? If NO: What should I do?

Currently I am using the following query:

rate(http_response_time_sum{application="myapp",handler="myHandler", status="200"}[1m])
/
rate(http_response_time_count{application="myapp",handler="myHandler", status="200"}[1m])

I am getting two "datasets". The value of the first is "NaN". I suppose this is the result from adivision by zero.

THX in advance!

(using spring-client)


回答1:


Your query is correct. The result will be NaN if there have been no queries in the past minute.



来源:https://stackoverflow.com/questions/47305424/measure-service-latency-with-prometheus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!