3

I would like to monitor request processing latency on my Tomcat server. It would be nice to perform some alerting based on this later. I configured Tomcat valve with %D pattern so it will log time taken to process each request in access log file. What would be correct way to calculate 50, 90, 99 percentiles from these log lines? I already have configured Prometheus and Grafana for basic host metrics(cpu/mem,hdd), but it is not clear to me how to correctly calculate percentiles and graph them with prometheus/grafana? Idea is to detect application hicckups and react before it goes totally unresponsive. Thank you all in advance!

brian-brazil
  • 3,904
  • 1
  • 20
  • 15
Ninja
  • 31
  • 1
  • 4
  • Using the tomcat_exporter seems to be the way to go. But keep in mind that tomcat nor the exporter knows how long it took for the request to get there. There is at least some duration for DNS resolution and you might have a reverse proxy in front of tomcat which can introduce delay too. For these things you can use the [blackbox_exporter](https://github.com/prometheus/blackbox_exporter). If you want measurements from multiple locations you can also check out [my service](https://latency.at) which runs blackbox_exporters for you in various locations. – Johannes 'fish' Ziemke Aug 30 '17 at 17:38

1 Answers1

4

You could use my tomcat_exporter to do this by configuring the filter for the response time metrics. Alternatively you could implement a similar filter by yourself.

rswart
  • 41
  • 2