Problem
As a health check, your load balancer (such as an F5 load balancer) periodically pings a specified webpage. In some cases when automatic browser injection is enabled, the JavaScript snippet added to the page header causes that check to fail. Depending on how the load balancer is set up, this can cause traffic to be routed to other application instances.
Solution
To prevent this, add the requestPathsExcluded
sub-element to your .NET agent's configuration. This is a reference to the virtual directory of the path in your application and not the full URL of the path you want to exclude.
For example, if your load balancer is set to ping a webpage in https://www.mywebsite.com/healthmonitor/
, insert /healthmonitor/
as the path regex value:
<!-- If you use both the Exclude and Attribute elements the Exclude element must be listed first. --><browserMonitoring autoInstrument="true"> <requestPathsExcluded> <path regex="/healthmonitor/"/> </requestPathsExcluded></browserMonitoring>
Cause
The browser agent is a JavaScript snippet injected into the header of a webpage. Sometimes it can prevent the health check monitor from seeing the information it needs to validate that the site is healthy. Excluding the path where the health check page is located will prevent the agent from injecting the snippet into the headers of specific pages.