2
votes

We have Azure cloud setup such that our client SPA talks to Azure APIM which then talks to Micro services. We have enabled Application Insights on each level to collect end to end telemetry.

Inside Application Map of Application Insights, we do see end to end flow for each request.

Only problem is that AppInsight instance (number 3 in image) is not correlated with anything and is shown outside the diagram.

I would expect to see No 1 > No2 and then No 3 arrow in one line showing the end to end flow.

Has anyone dealt with this kind of issue regarding application map inside application insights ?

Azure Application Map

1
Couple questions. Do you see that End-to-end Transaction Details shows everything correctly and actually connects #2 with #3? Can you please attach a picture and put #s there as well?ZakiMa

1 Answers

2
votes

I had the same issue. To fix it helps to understand how this diagram works:

Inside 'Application Map' the items will be connected by correlation of dependency entities (send by Client) with request entities (send by Server):

  1. dependencyTelemetry.OperationId = requestTelemetry.OperationId
  2. dependencyTelemetry.Id = requestTelemetry.ParentId

The common approach for http calls seems that client sends required info as part of http request header. On both ends either own code per service method or middleware services handling request/send pipeline will be required.

The use of nuget Microsoft.ApplicationInsights.AspNetCore related to .NET Core 3.1 will add such services.

Example of http header send by this nuget package, version 2.13.0 + using default configuration:

  • Request-Context: appId=cid-v1:12345678-60ba-4f61-ae37-07da9dc13267
  • Request-Id: |abcdefdc99366a48a3886f34fb41c781.0102cca5a4ecc64f.
  • traceparent: 00-abcdefdc99366a48a3886f34fb41c781-0102cca5a4ecc64f-00

where

  • Request-Context: appId as shown in AplicationInsights portal. legacy + for scenarios connecting 2 different Application insights
  • Request-Id: Legacy but current used header to transfer operation id + parent
  • traceparent: Adds support for upcoming new W3C standard

  • abcdefdc99366a48a3886f34fb41c781: OperationId, 16-byte as hex by W3C standard

  • 0102cca5a4ecc64f: ParentId, 8-byte as hex by W3C standard

see also document 'Telemetry correlation in Application Insights' https://docs.microsoft.com/en-us/azure/azure-monitor/app/correlation