.NET APM Agent issue with .NET WebAPI Virtual Path


We are hosting the .NET 4.5 Web API on IIS. All paths have been grouped under “HttpControllerHandler” for some reasons. I saw a few posts about the grouping issue but I do have the latest APM agent. I just installed it. I can’t use the custom instructmentation or set transaction name from code. I am hoping a way to make the APM agent understand those .NET web api part.


NOTE: I couldn’t edit my own post above. @nmcnamara added some tags to my post but I couldn’t find “Edit Post” button anymore so I am posting this as a reply to provide you more information.

For NR Support, here are the link https://onenr.io/0Z2R5ee4xRb (I can see the data in last 30 mins) and https://onenr.io/0GbRm774BQy (I need to use 24 hours data to see the issue. )

Any idea? Anyone? maybe NR Support? @cmancuso ?

Maybe New Relic .NET agent limitation? Any use New Relic + Web API (.NET Fullframework or Core)?

I am getting this for another MVC project.

I’ve checked the following posts.

I can’t use SetTransactionName API or HttpModule or or custom middleware or AddCustomParameter since the code is not our code.

Hi Support, If you are reading this, do you think you can release “metric clamp”.
I already have the latest agent.

@DL-MTG-NewRelic -

Looking here I see the segment System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsync().

The presence of that segment is a symptom the agent has shutdown its MVC/WebAPI instrumentation wrapper. That method is one the agent instruments in a special way in order to name MVC/WebApi transactions. When the segment is present in the breakdown table it means that naming instrumentation has been disabled - agent logs (may debug or finest) likely show this is happening.

The most likely cause/solution is to be found in this post: Missing .NET async metrics | New Relic Documentation

I hope that helps.

1 Like

Thanks. I have updated the config as per doc.

<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />

<httpRuntime targetFramework="YOUR_TARGET_NET_VERSION" /> 

I will monitor the application and will let you know. Thanks.

1 Like

Keep us posted and let us know @DL-MTG-NewRelic!

1 Like

It works. We have been monitoring it for a while… All good for now. Thanks, guys!