You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
It is reported that external calls made by HttpClient inside a WCF IIS Hosted service endpoint are not tracked by the agent. I am able to repro the behavior by calling the the HttpClient multiple times in async/await fashion in side a test WCF service hosted in IIS (ASP compatible mode enabled).
[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
public class Service1 : IService1
{
public async Task<string> MakeSomeExternalCall()
{
var httpClient = new HttpClient();
var a = await httpClient.GetAsync("https://google.com");
var b = await httpClient.GetAsync("https://bing.com");
var c = await httpClient.GetAsync("https://yahoo.com");
return $"{a.IsSuccessStatusCode} + {b.IsSuccessStatusCode} + {c.IsSuccessStatusCode}";
}
}
While investigating the issue, I notice the following messages in the agent log:
The log messages indicate that the first external call was successfully tracked because it was executed on the same thread as the caller (tid: 15). However, the agent failed to track the second external call because it was executed on a different thread (tid: 16)--> no transaction found.
The agent seems to make the assumption that async calls executed in async/await fashion executed on same thread as the caller, but this prove to be inaccurate.
Expected Behavior
External calls made with HttpClient should be tracked by the agent.
Description
It is reported that external calls made by HttpClient inside a WCF IIS Hosted service endpoint are not tracked by the agent. I am able to repro the behavior by calling the the HttpClient multiple times in async/await fashion in side a test WCF service hosted in IIS (ASP compatible mode enabled).
While investigating the issue, I notice the following messages in the agent log:
The log messages indicate that the first external call was successfully tracked because it was executed on the same thread as the caller (
tid: 15
). However, the agent failed to track the second external call because it was executed on a different thread (tid: 16
)--> no transaction found.The agent seems to make the assumption that async calls executed in async/await fashion executed on same thread as the caller, but this prove to be inaccurate.
Expected Behavior
External calls made with HttpClient should be tracked by the agent.
Steps to Reproduce
Repro app included.
WcfService1.zip
Your Environment
WCF service hosted in IIS, Asp compatibility mode enabled.
The text was updated successfully, but these errors were encountered: