Skip to content

Make Application Insights ServerTelemetryChannel flush interval (MaxTelemetryBufferDelay) configurable in the worker #3465

Description

@RohitRanjanMS

Summary

The Application Insights ServerTelemetryChannel (registered by AddApplicationInsightsTelemetryWorkerService()) buffers telemetry in memory and flushes it to the ingestion endpoint based on MaxTelemetryBufferDelay (default 30 seconds in the App Insights SDK, or sooner once the buffer fills). The Microsoft.Azure.Functions.Worker.ApplicationInsights integration does not expose this, so customers cannot tune how quickly telemetry becomes visible without reaching into the channel themselves.

Request

Expose the channel flush interval as a configurable option on the Functions worker Application Insights integration, and apply it to the ServerTelemetryChannel.

Proposed behavior

  • New public FunctionsApplicationInsightsOptions.MaxTelemetryBufferDelay (TimeSpan), default 8 seconds, minimum 5 seconds.
  • Configurable via a new ConfigureFunctionsApplicationInsights(Action<FunctionsApplicationInsightsOptions>) overload:
services
    .AddApplicationInsightsTelemetryWorkerService()
    .ConfigureFunctionsApplicationInsights(o => o.MaxTelemetryBufferDelay = TimeSpan.FromSeconds(8));
  • Only applied when the configured telemetry channel is a ServerTelemetryChannel. Values below the 5s minimum throw ArgumentOutOfRangeException.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions