APM Tracing appears to stop doing a full trace in WebAPI 2.2

Tim.Shepherd

Posted on
May 20 2021

Hello

I have the Raygun AP agent installed on my server and it is pointed to the correct app pool for my WebAPI 2.2 web app.

Going to try to describe this as best I can...

I am trying to understand the traces: I am calling a route on the web app (using Swagger) but all I can see in the flamechart is ASP.NET system calls (in grey) and I can see My Code (purple) up to the SendAsync call in a MessageHandler before hitting the controller code, and then nothing else. There is a "gap" in the trace timeline where my deeper code is working and then I can see the end of the messagehandler's Async call being traced.

The route works successfully - I just can't see any of my controller code, deeper api code, database queries, etc in the trace. It doesn't seem to matter which webapi route call I make - anonymous or authorised - the traces are all missing the "middle bit" :)

I've edited to put some screenshots. Am I misunderstanding the sampling concept? This is still set to the 1 sample per 1 trace per 1 minute default.

I have noticed that if I deregister and re-register the app pool (or recycle the pool) in the Raygun Agent, the very first call to our API, the trace DOES capture everything but if I execute the call again straight-away, the trace behaviour goes back to what I described above.

Another odd thing is that the authenticate route always gets a full trace, but this is going through OWIN, not through my controllers.

Open to ideas!!


Deleted User

Raygun

Posted on
May 21 2021

Hey Tim, thanks for those images - they explain the problem clearly.

I have a few guesses as to what may be happening here, but first I'd like to know:

  1. Have you enabled "Low Overhead Mode,"? This will be visible in the Raygun Profiler Configuration tool after selecting the app pool you've configured.
  2. If you could send us your agent-configuration.json file from C:\ProgramData\Raygun\AgentSettings (you are welcome to contact us via our support channel if you would rather)

With those I should be able to rule out any kind of code filtering stopping those methods from showing up, in which case the problem could be thread-related.

Cheers!


Tim.Shepherd

Posted on
May 21 2021

Hi Deacon

Thanks for the reply - in answer to your questions:

  1. I don't have Low Overhead Mode on. I did do a toggle of the mode to switch it on and then off again, to ensure that the setting was off, but there was no change in the tracing behaviour.

  2. I've got the config json file but I am not sure how to send it to you securely - I tried to send it via the "Email Support" link on the "Contact Us" page but I got a 500 error (I pasted the json directly into the form :) ). I'd rather not attach it here if possible, given it has the api key and some ids in it. Is there a support email I can send to?

In looking at the config file though, it has got a "extra site" listed in it that does not appear in the WPF configuration tool? The site has got the same api key as the one I am trying to test with - could this be messing things up maybe? I did use the Agent a few months ago in a trial which then lapsed and we've only just recently enabled APM again.

Another thing - we have had the Stackify Agent install on the server as well but it's agent service is stopped - should I ask for a reboot of IIS/the server itself to ensure the Stackify agent is not in IIS memory somewhere?

Tim


Deleted User

Raygun

Posted on
May 23 2021

Hi Tim, thanks for checking those things for me.

Usually if another profiler is interfering then you wouldn't see any traces at all, but if it's not too inconvenient then it would still be good to restart/recycle the IIS App Pool hosting your application.

We can continue this discussion over email, if you send your issue through to support@raygun.com

-Deacon


Tim.Shepherd

Posted on
May 23 2021

Hi Deacon

No worries - I have emailed you.

Tim


Reply