Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
432 stars 184 forks source link

Getting Application Insights spam ("Invoke") #2698

Open RobTF opened 2 months ago

RobTF commented 2 months ago

Description

I get far too many "Invoke" dependency items in Application insights.

Have tried; services.AddApplicationInsightsTelemetryWorkerService(o => o.EnableDependencyTrackingTelemetryModule = false);

and

services.AddApplicationInsightsTelemetryProcessor<RemoveInvokeTelemetryProcessor>();

////
public sealed class RemoveInvokeTelemetryProcessor(
    IOptionsMonitor<TelemetryFilterOptions> options,
    ITelemetryProcessor next) :
    ITelemetryProcessor
{
    /// <inheritdoc/>
    public void Process(ITelemetry item)
    {
        if (options.CurrentValue.FilterInvokeDependencyItems)
        {
            if (item is DependencyTelemetry dependency && dependency.Name == "Invoke")
            {
                // Do not send telemetry for the "Invoke" dependency.
                return;
            }
        }

        next.Process(item);
    }
}

Still I get this;

image

Any ideas? Is an absolute killer on high frequency function apps.

thanks!

Steps to reproduce

Create function app with Application Insights.

Run function app.

Observe

augusthjerrild commented 3 weeks ago

Experiencing the exact same issue. Any news?