Hello Gallatin 21V,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that the end-to-end transaction details shows telemetry data of the same level in wrong order.
You can resolve this by the followings:
Use KQL logs instead of relying on the UI:
traces
| where operation_Id == "<your-operation-id>"
| order by timestamp asc
This guarantees chronological order regardless of UI rendering - https://learn.microsoft.com/en-us/azure/azure-monitor/app/distributed-trace-data
Ensure Proper APIM Integration by follow this guide - https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-app-insights you can make sure there is proper APIM Integration.
You can disable adaptive sampling if using .NET Core SDK, set these environment variables:
APPLICATIONINSIGHTS_ENABLEADAPTIVESAMPLING=false
MicrosoftAppInsights_AdaptiveSamplingTelemetryProcessor_MinSamplingPercentage=100
MicrosoftAppInsights_AdaptiveSamplingTelemetryProcessor_InitialSamplingPercentage=100
But:
- Your SDK version must support these variables.
- App must restarted after setting them
- If using legacy SDK, these variables won’t work. You must disable sampling in code:
var aiOptions = new ApplicationInsightsServiceOptions();
aiOptions.EnableAdaptiveSampling = false;
services.AddApplicationInsightsTelemetry(aiOptions);
Finally, validate correlation setup to ensure each telemetry item sets:
-
operation_Id
(shared across transaction) -
operation_parentId
(points to parent telemetry) - Use W3C TraceContext headers for distributed tracing - https://learn.microsoft.com/en-us/azure/azure-monitor/app/distributed-trace-data
I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.