How to stop logging excessive ServiceBusReceiver.Receive Dependency logs to App Insights
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
Applications that poll Azure Service Bus often produce a large number of dependency telemetry entries named ServiceBusReceiver.Receive. Those entries can flood Application Insights, increase ingestion cost, and make genuinely useful failures harder to spot.
Why These Logs Appear So Often
Application Insights and Azure SDK instrumentation treat Service Bus operations as external dependencies. If your code calls receive in a loop, every receive attempt may generate dependency telemetry, even when no message is returned.
That behavior is technically correct, but it is not always useful. A high-volume worker that polls frequently can generate far more receive telemetry than business telemetry.
First Fix the Receive Pattern
Before filtering telemetry, make sure the application is using the right API. If you currently poll manually with ServiceBusReceiver.ReceiveMessagesAsync, consider ServiceBusProcessor, which is event-driven and usually produces less noisy code.
This approach reduces the need for an explicit receive loop and often makes the telemetry pattern easier to reason about.
Filter the Dependency Telemetry in Application Insights
If the receive calls are still too noisy, add a telemetry processor that drops only the dependencies you do not want. This is more precise than global sampling because you can target the exact dependency name.
Register it in your application startup:
This keeps requests, traces, exceptions, and other dependencies intact while dropping only the ServiceBusReceiver.Receive noise.
Sampling Versus Filtering
Sampling reduces overall telemetry volume, but it does not specifically solve this problem. If your goal is to remove one repetitive dependency and keep everything else, filtering is the better tool. Sampling is still useful when the total telemetry volume is high across the board, but it can also hide rare events if you set it too aggressively.
A practical strategy is:
- Use targeted filtering for known noisy dependencies
- Use sampling only if ingestion volume is still too high after filtering
Verify the Effect Safely
After deploying the filter, run a short validation window in a non-production environment. Compare total dependency counts before and after the change and confirm that failed Service Bus operations you care about are still visible. If you need failures but not successful receives, extend the processor so it only drops successful dependencies.
Common Pitfalls
- Filtering by name alone can be too broad if other dependencies share similar names, so include the dependency type as well.
- Do not rely on sampling when the real issue is one specific high-volume dependency.
- If polling is the root cause, filtering telemetry treats the symptom rather than the design.
- Always verify that useful failures are still retained after adding a telemetry processor.
Summary
- '
ServiceBusReceiver.Receiveentries are common in polling-based Service Bus consumers.' - Start by improving the receive model, often by switching to
ServiceBusProcessor. - Use a custom telemetry processor to drop only the noisy dependency entries.
- Validate the filter carefully so you do not remove the failures and latency data you still need.
Related reading
- how to stop/pause a pod in kubernetes
- How to store AWS Cognito User Pool users in DB for instance DynamoDB?
- How to store user information with DynamoDB and Cognito using Facebook authentication with iOS SDK
- How to support GUID in Windows Azure Mobile services
- How to stop Replicaset from restarting?
- How to support multiple deployments in a microservice CI/CD pipeline
- How to stop Python Kafka Consumer in program?
- How to supply value to an annotation from a Constant java

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.