### Async HttpClient Dependency Call (C#) Source: https://github.com/degant/application-insights-best-practices/blob/master/README.md Demonstrates an asynchronous HTTP GET request using `HttpClient`. This type of async dependency call is noted as a scenario where Application Insights correlation with the parent request may fail. ```C# await (new HttpClient()).GetAsync("http://www.github.com"); ``` -------------------------------- ### Logging Telemetry on Background Thread (C#) Source: https://github.com/degant/application-insights-best-practices/blob/master/README.md Illustrates logging both a custom event and an exception within a `Task.Run` block. Telemetry logged on background threads like this can lose correlation with the originating web request in Application Insights. ```C# Task.Run(async () =>\n{\n telemetryClient.TrackEvent("SampleCustomEventOnBackgroundThread");\n telemetryClient.TrackException(new System.InvalidOperationException("Background Thread Exception"));\n}); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.