Azure / Azure/azure-functions-host

AzureMonitorDiagnosticLogger dynamic enable/disable

Open
#6,759 0 comments 0 reactions 1 assignee Assigned to @mathewc View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

Currently the AzureMonitorDiagnosticLogger is always in the logging pipeline, regardless of whether it is actually enabled via [diagnostic settings](https://docs.microsoft.com/en-us/azure/azure-functions/functions-monitor-log-analytics?tabs=csharp). Performance testing with the logger disabled in the host shows ~ 18% RPS improvement and ~ 15% latency improvement. So we really only want to enable this when needed.

Proposal: We add a new `WEBSITE_FUNCTIONS_AZUREMONITOR_ENABLED` environment variable that DWAS will use to pass us the enablement state of the feature, since this is tracked in SiteConfig. The host will only add the logger if either the setting isn't present (for back compat), or if it's present and the value is 1. This will enable us to release a host version that supports disabling this, ahead of the DWAS changes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.