Azure / Azure/azure-functions-host
How to filter or suppress built-in Application Insights telemetry in Azure Functions when using OpenTelemetry?
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
#### Is your question related to a specific version? If so, please specify:
Azure Functions (isolated worker) version 4
#### What language does your question apply to? (e.g. C#, JavaScript, Java, All)
.NET 9
#### Question
We are evaluating Azure Functions (isolated worker) with OpenTelemetry and Application Insights integration.
According to the [official guide](https://learn.microsoft.com/en-us/azure/azure-monitor/app/worker-service) and the [Azure Monitor OpenTelemetry Distro documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable#enable-azure-monitor-opentelemetry-for-net-nodejs-python-and-java-applications), new applications should use OpenTelemetry with the Azure Monitor exporter. For Azure Functions, the documentation points to [this guide](https://learn.microsoft.com/en-us/azure/azure-functions/opentelemetry-howto?tabs=app-insights%2Cihostapplicationbuilder%2Cmaven&pivots=programming-language-csharp).
Following these instructions, we set the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable as required. This allows us to see OpenTelemetry-exported telemetry in Application Insights. However, it appears that setting this environment variable also enables the built-in telemetry from the Functions host.
Our issue:
Some traces can be filtered using OpenTelemetry processors or instrumentation filters, but other telemetry—such as dependency telemetry from the CosmosDbTrigger's Change Feed polling (e.g., frequent GET requests to /dbs/[database]/colls/[container]/docs)—cannot be filtered out this way. This results in a large amount of noisy telemetry in Application Insights.
How can we filter or control what is sent by each pipeline, especially for noisy dependencies like Cosmos DB polling?
Any clarification on the expected behavior, configuration options, or references to best practices would be greatly appreciated.
Thanks in advance!
Contributor guide
Research direction
Start with the linked Azure Functions OpenTelemetry how-to and Azure Monitor OpenTelemetry documentation, then compare the OpenTelemetry pipeline with the Functions host's built-in telemetry described in the question. Done means documenting whether each pipeline can be configured independently and how noisy Cosmos DB polling dependencies should be controlled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud, observability
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100