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!

  • 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. If you want measurements from multiple locations you can also check out my service which runs blackbox_exporters for you in various locations. – Johannes 'fish' Ziemke Aug 30 '17 at 17:38

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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.