[BUG] TelemetryItem tag ai.operation.parentId not set when Activity.Parent is null when Activity.ParentSpanId is defined #20433
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Monitor - Exporter
Monitor OpenTelemetry Exporter
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
Workflow: This issue is responsible by Azure service team.
Describe the bug
When starting a new Activity with passing a parent ActivityContext that has ParentSpanId set the Parent property on Activity is null while the ParentSpanId is set.
In the current implementation the Activity.ParentSpanId is not used and that results in the TelemetryItem not having the tag ai.operation.parentId set.
Examples when this happens is if one or more activities are not part of the ActivitySource that is being monitored. Then the started activities has the parent set manually from ActivityContext to maintain the link between them regarding parents.
Expected behavior
The ai.operation.parentId tag should be set when Activity.ParentSpanId is set
Actual behavior (include Exception or Stack Trace)
The ai.operation.parentId is not set when the Activity is created with a ActivityContext passed as the Parent property is null
To Reproduce
Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)
Environment:
The text was updated successfully, but these errors were encountered: