Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.92k stars 441 forks source link

Supress/block Appinsights request telemetry for single function #10252

Open pusohi opened 3 months ago

pusohi commented 3 months ago

I would like to suppress telemetry from single function in Azure function app from going to Appinsights. Currently there is no way to block "request" telemetry from all azure functions.

Scenario: 2 geo distributed fn apps (WUS2 & EUS2) are behind a Azure Front Door (AFD) For AFD to determine health of each backend fn app, each fn app exposes a probe endpoint which simply returns 200 ok The probe endpoint gets called every few seconds. This overwhelms AppInsight logs

Most telemetry for each individual function can be controlled with host.json settings as below

"version": "2.0", "logging": { "logLevel": { "default": "Trace", "Function.main_endpt": "Trace", // will log trace & higher "Function.probe_endpt": "Trace" // will log trace & higher },

Setting "Function.probe_endpt": to "Trace", "None", "" or "Critical" will suppress all telemetry expect request telemetry.

The request in this feature is to allow control of request telemetry per each endpoint of a function app. Ideal if this can be controlled using host.json or config setting

BigMorty commented 3 months ago

@fabiocav for awareness