Azure / Azure/azure-functions-dotnet-worker
TraceContext remains empty despite Diagnostic-Id in ServiceBusTrigger messages
- Dominant language
- C#
- Stars
- 466
- Forks
- 215
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 7
Description
In an isolated function that uses a `ServiceBusTrigger`, the input message contains a `Diagnostic-Id` (populated by the Azure SDK). However, it appears that this is not read, as the TraceContext remains empty.
After reviewing the discussion at https://github.com/Azure/azure-functions-dotnet-worker/issues/410, it seems that integrating AppInsights should solve the issue. So I add the following services :
```csharp
services.AddApplicationInsightsTelemetryWorkerService();
services.ConfigureFunctionsApplicationInsights();
```
but it is still empty.
Under what circumstances is the TraceContext valid?
I am testing locally with this configuration:
```xml
```
```shell
Core Tools Version: 4.0.5198 Commit hash: N/A (64-bit)
Function Runtime Version: 4.21.1.20667
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the isolated ServiceBusTrigger scenario with the package and runtime versions listed in the issue. Inspect how the input message's Diagnostic-Id relates to TraceContext, including the Application Insights registrations shown. Done means establishing the conditions under which TraceContext is populated or documenting and fixing the missing propagation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100