APM transaction data for very long or infinite HTTP Requests

Hi,

If I understand correctly the APM .net agent sends transaction details to APM only when a http request ends (either with an error or success result). What if a http request has an error and it is an infinite call spinning 100% CPU? I will not receive it...

I am experiencing some 100% spikes on my ASP.net MVC application. There is an .net full framework APM agent installed 1.7.1. I suspect that some of the methods with specific parameters may execute infinitely (or for long time). If my above reasoning is correct I will not get such transactions in APM, don't I?

Can I do anything with this? I was thinking about the executionTimeout setting from MVC but it seems it is no longer working since MVC4.0 and I could not make it working with the workarounds provided: c# - .NET Execution Timeout Not Taking Effect in an MVC Web Project - Stack Overflow

APM Server version: 7.13

APM Agent language and version: .net full framework 1.7.1

Hi @kbalys,

You're correct, the .NET agent only sends a transaction when it has ended. For the ASP.NET integration, this happens in OnEndRequest.

You won't get the transactions if the handling of a request never finishes, but you will if it does finish, even if it takes a long time. If requests are never finishing, that sounds like a bigger issue to resolve; if there are services that are instrumented in the handling of a request, you may get the spans for these, and could use Kibana console or the search API of Elasticsearch to get these from the span indices. My suggestion would be to use a debugger or profiler to see what is happening in the case where requests never seem to finish, as this sounds like a more fundamental application problem.

Hi @forloop,

thank you for your response. I wanted to verify my theory that we had some infinite / long running methods and I thought that APM would help this but unfortunately this is not supported because the transaction must end to be send to APM server.

I think that this is a bit problematic that we get the transactions only after they finish. Usually when something bad happens on the server (CPU spike, crash) we would not have the culprit transactions logged, not even the fact that they started. I wonder if two step logging isn't a better solution so APM agent would send some data when transaction is started, and second event when completed. Do you think it is worth raising as feature request?