I had Angular2 and Asp.Net Web API applications for that I configured the Application Insights Resource for tracking custom telemetry of those applications. But I used two different AI keys, one for Angular2 application and one for Web API application.
I used to correlation feature to correlate the Two Applications Insights telemetry of Front End calls and Web API calls but operation ID did not match.
Can you please tell me how to correlate the two AI’s telemetry of Front End calls and Web API calls using correlation feature.
Edit: Fixing per the additional information in comment.
You sound like you want to correlate the dependent requests with the server request. This is usually handled by the combination of two pieces:
disableCorrelationHeaders = false
in the JavaScript snippet configOperationCorrelationTelemetryInitializer
added in the ApplicationInsights.config under the <TelemetryInitializers>
sectionThe JavaScript setting will set the x-ms-request-id
and the x-ms-request-root-id
header to be picked up by the telemetry initializer.
The initializer relies on the HttpContext.Request being available.
Using separate instrumentation keys (iKeys) will not matter when it comes to setting the operation id. Where it will matter is when you go to look for this correlated telemetry in the UI. If everything flows to the same iKey it will be able to be retrieved.
The next thing to be mindful of is if your server side telemetry is being sampled. By default the AdaptiveSampling processor is enabled and set to only send 5 telemetry items per second.
Steps to troubleshoot
x-ms-request-*
headers are being set.System.Web.HttpContext.Current.Request.Headers["x-ms-request-id"]
or System.Web.HttpContext.Current.Request.Headers["x-ms-request-root-id"]
is present<Add Type="Microsoft.ApplicationInsights.Web.OperationCorrelationTelemetryInitializer, Microsoft.AI.Web"/>
is added in the <TelemetryInitializers>
section of your ApplicationInsights.config<MaxTelemetryItemsPerSecond>
to a large number like 5000If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With