Browser Agent snippet is not inserted (Java)

Document ID : KB000091899
Last Modified Date : 25/03/2019
Show Technical Document Details
Browser Agent snippet is not inserted (Java) - Checklist
10.5 and higher version
1.- Verify that unsupported browser traffic has occurred
Check sustainability metric: Agent Stats | Sustainability | Browser Agent Business Transaction : introscope.agent.browseragent.unsupportedBrowsers.count
Check the Product Compatibility Matrix for supported browsers.

2. If you are using Java Agent 10.5.0 & 10.5.1:
- check that browseragent.pbd has been uncommented in the <agent-home>/core/config/<appserver>-typical or full.pbd
- check that <agent>/examples/APM/BrowserAgent/ext/BrowserAgentExt.jar has been copied to <agent>/core/ext

3.-  Automatic snippet injection depends on the below Agent properties, make sure they have been enabled and configured in the IntroscopeAgent.profile
NOTE: Verify that the URLs you are expecting to monitor match the includeURLsRegex
4.- Check if the Content-Type of the resource is “text/HTML”
see Browser Agent Prerequisites:

5.- Review the Introscope agent logs to verify the snippet file location is correct and valid.

The Snippet file instruct the Browser Agent where to download the BA.js profile and the BAExt.js file
By default introscope.agent.browseragent.autoInjection.default.snippetLocation=../config/default.basnippet
If there is a problem a message will be reported in the agent log, for example:
[ERROR] [IntroscopeAgent.BrowserAgent] C:\CA\apm\wily\core\config\test.basnippet, this file is empty or not readable.
6.- Check the browser console for any error or warn message.
Enable “browserLoggingEnabled” in the <DXC_HOME>/browserAgent/wa/ba/profile/default-tenant/default-app/profile.json. By default logging is disabled.
Push the updated profile to DxC(s) by running:  : <DXC_HOME>/bin/ -baDir <DXC_HOME>/browserAgent/wa
Make sure DxC is up and running.
In your browser press F12, go to the “Console” tab, refresh the page, you should see [CA Browser Agent] entries as below, make sure no ERROR messages are reported 

7.- Check the page response content encoding, if the content encoding is not null, the auto injection will stop stopped and the response will not be edited.
For example if Content-Encoding=gzip then set introscope.agent.browseragent.contentencoding.enabled=true

8.- Review the agent logs for errors – place the logging level in trace mode to get deeper information about the steps taken.
Open the IntroscopeAgent.profile, set,logfile, reproduce the issue and contact CA Support.
9.- Check if the snippet is inserted in the correct place.  Review the page source and see if the <head> tags are commented out. In this case the snippet might be inserted but commented out.
The snippet is always inserted after the <head> tag in the source page. Open the page you need to monitor, right click, select “View Source Page”, verify that the snippet  has been inserted, below example:

Note: Java agent adds the x-apm-ba-response-b field into the <script> tag in the response content when the introscope.agent.browseragent.response.decoration.enabled property is set to true and the request URL matches the introscope.agent.browseragent.response.decoration.includeURLsRegex. This information is used for Transaction correlation
10.- Verify the below sustainability metrics:
a) Check if the agent has reached throttle clamp: Agent Stats | Sustainability | Browser Agent Business Transaction : introscope.agent.browseragent.autoInjection.responseCount
If the value is greater than the value of introscope.agent.browseragent.autoInjection.throttleResponseLimit property, increase the introscope.agent.browseragent.autoInjection.throttleResponseLimit property value in agent profile and try to visit page again
b) Check if current request has reached snippet maximum searching length for response content :  Agent Stats | Sustainability | Browser Agent Business Transaction : introscope.agent.browseragent.autoInjection.snippet.maxSearchingReached.count
If the value is greater than 0, increase the introscope.agent.browseragent.autoInjection.snippet.maxSearchingLength property value in agent profile and try to visit page again
11.- If you do not see log entries from “[IntroscopeAgent.BrowserAgent]” in the IntroscopeAgent.log, check if the BRTMTracer is instrumenting the proper entry point in the application stack. Open the AutoProbe log search for “inserted method tracer object allocation: com/wily/introscope/agent/brtm/trace/BrtmTracer