When using both Application Insights SDK and the OpenTelemetry exporter, we have:
Application Insights SDK creates its own internal activities that are not tracked by OpenTelemetry, resulting in orphaned spans in OpenTelemetry observability vendors.
Application Insights SDK doesn't track our own custom activities, but still it uses them as parent IDs for its own activities, also resulting in orphaned spans in Application Insights.
Description of the fix:
Only when using both Application Insights SDK and the OpenTelemetry exporter, use the overload of TelemetryClient.StartOperation(...) that accepts an activity as a parameter. When providing our own custom activity, Application Insights SDK will make sure to fix the parent-child span relationship.
Description of the issue:
When using both Application Insights SDK and the OpenTelemetry exporter, we have:
Application Insights SDK creates its own internal activities that are not tracked by OpenTelemetry, resulting in orphaned spans in OpenTelemetry observability vendors.
Application Insights SDK doesn't track our own custom activities, but still it uses them as parent IDs for its own activities, also resulting in orphaned spans in Application Insights.
Description of the fix:
Only when using both Application Insights SDK and the OpenTelemetry exporter, use the overload of
TelemetryClient.StartOperation(...)
that accepts an activity as a parameter. When providing our own custom activity, Application Insights SDK will make sure to fix the parent-child span relationship.