Azure / Azure/azure-functions-dotnet-worker
Consider config for opting out of Worker Dependency logs
- Dominant language
- C#
- Stars
- 466
- Forks
- 215
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 7
Description
### Description
We should consider providing a config based way for customers to opt out of the default dependency logging the worker does on function invocations (code [here](https://github.com/Azure/azure-functions-dotnet-worker/blob/c4113d1c5936ab3235d7a73ec5a88596977c8335/src/DotNetWorker.Core/Diagnostics/FunctionActivitySourceFactory.cs#L32)). These logs show up as "Invoke" internal dependencies:

Currently the only way for customers to remove these Invoke dependency logs is to write a custom telemetry processr, as in [this](https://github.com/RohitRanjanMS/ApplicationInsightsDemo/blob/main/Isolated/IsolatedApplicationInsightsDemo/CustomTelemetryProcessor.cs) sample:
```csharp
public class CustomTelemetryProcessor : ITelemetryProcessor
{
private ITelemetryProcessor Next { get; set; }
// Link processors to each other in the chain.
public CustomTelemetryProcessor(ITelemetryProcessor next)
{
this.Next = next;
}
public void Process(ITelemetry telemetry)
{
if (telemetry is DependencyTelemetry dependency && dependency.Name == "Invoke")
{
// Do not send telemetry for the "Invoke" dependency.
return;
}
// Call the next processor in the chain.
this.Next.Process(telemetry);
}
}
```
This came up recently in CRI https://portal.microsofticm.com/imp/v5/incidents/details/564586958/summary.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/DotNetWorker.Core/Diagnostics/FunctionActivitySourceFactory.cs and compare its default dependency logging with the linked CustomTelemetryProcessor sample. Define the configuration entry point and verify that opting out suppresses only the "Invoke" dependency logs while preserving other telemetry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100