Azure / Azure/azure-functions-dotnet-worker
Dependency correlation missing for dotnet-isolated functions
- Dominant language
- C#
- Stars
- 466
- Forks
- 215
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 7
Description
This is my first contribution here, so apologies if this has already been asked and answered. I checked existing issues but could not find mine exactly.
I am running a couple of .net 5 (_dotnet-isolated_) functions with Application Insights added to them. I can see requests to my http triggered functions coming in to the livestream in the Azure Portal. So far so good.
Now, it is my understanding that it is a known issue that dependencies are not automatically tracked as of yet.
I therefore modified my startup class by adding insights in code
```
public class Program
{
public static void Main()
{
var host = new HostBuilder()
.ConfigureServices((hostbuilderContext, services) => services.AddApplicationInsightsTelemetryWorkerService(options =>
{
}))
.Build();
host.Run();
}
}
```
That seems to work too, I now see dependencies in the Azure Portal whenever I trigger my function.
However, the requests and their corresponding dependencies are not correlated. I can see both apart from each other, but I do not get a neat timeline for a single operation.
My hunch is that this is due to the fact that I am running my functions out of process (_isolated_) and there is no way for Application Insights to correlate the two. I suspect the request telemetry comes from the host process (as I don't see it hitting a breakpoint I set in a custom TelemetryInitializer) and the dependency telemetry comes from my function process. Would I be right in assuming that? Or am I missing something else?
Is there anything I can do to make Application Insights telemetry correlation work for my case?
Also, notice I call AddApplicationInsightsTelemetryWorkerService with an empty configuration action. If I call the overload without parameters (AddApplicationInsightsTelemetryWorkerService()), dependencies still do not get tracked. This to me seems like a bug also.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Program.Main configuration shown in the issue and reproduce telemetry for an HTTP-triggered .NET isolated function using Application Insights. Compare request telemetry from the host process with dependency telemetry from the worker process; done means identifying whether correlation is supported and documenting or fixing the required configuration. No repository files or tests are named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100