How to correlate telemetry data with AI AI of Front End calls and Web API calls using the correlation function

I had Angular2 and Asp.Net Web API apps for which I configured the Application Insights resource to track the custom telemetry of those apps. But I used two different AI keys, one for Angular2 app and one for Web API app.

I used correlation to match Two Applications Insights telemetry with Front End calls and Web API calls, but the operation ID was not a match.

Could you please tell me how to correlate two AI telemetry with Front End calls and Web API calls using correlation function.

+3


source to share


1 answer


Edit: Correction for more information in the comment.

It sounds like you want to associate dependent requests with a server request. This is usually handled by a combination of two parts:

The JavaScript setup will set the header x-ms-request-id

and x-ms-request-root-id

use the telemetry initializer.

the initializer relies on the available HttpContext.Request.



The use of individual instrument keys (iKeys) is irrelevant when it comes to setting the operation ID. Where does it matter when you go looking for this correlated telemetry in the user interface. If everything flows to the same iKey, it can be restored.

The next thing to keep in mind is sampling the telemetry system on the server side. By default, the AdaptiveSampling processor is enabled and configured to only send 5 telemetry units per second.

Troubleshooting steps

  • When the request is sent from the browser, use the Fiddler or F12 tools to ensure the headers are set x-ms-request-*

    .
  • Debug your WebAPI application and confirm that System.Web.HttpContext.Current.Request.Headers["x-ms-request-id"]

    orSystem.Web.HttpContext.Current.Request.Headers["x-ms-request-root-id"]

  • Make sure to <Add Type="Microsoft.ApplicationInsights.Web.OperationCorrelationTelemetryInitializer, Microsoft.AI.Web"/>

    add to <TelemetryInitializers>

    your ApplicationInsights.config section
  • Increase <MaxTelemetryItemsPerSecond>

    to a large number, for example 5000
  • Make sure you are using v2.2.0 or higher .NET SDK
+2


source







All Articles