Browser Agent snippet is not inserted (Java)

Document ID : KB000091899
Last Modified Date : 18/04/2018
Show Technical Document Details
Introduction:
Browser Agent snippet is not inserted (Java) - Checklist
Environment:
10.5 and higher version
Instructions:
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.- Automatic snippet injection depends on the below Agent properties, make sure they have been enabled and configured in the IntroscopeAgent.profile
 
introscope.agent.browseragent.autoInjectionEnabled=true
introscope.agent.browseragent.autoInjection.appID=<key1>
introscope.agent.browseragent.autoInjection.<key1>.includeURLsRegex=<Regex>
 
NOTE: Verify that the URLs you are expecting to monitor match the includeURLsRegex
 
3.- Check if the Content-Type of the resource is “text/HTML”
 
see Browser Agent Prerequisites: https://docops.ca.com/ca-experience-collector/en/browser-agent/implement-the-browser-agent#ImplementtheBrowserAgent-VerifytheBrowserAgentPrerequisites

4.- 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.
 
5.- 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/uploadBA.sh -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 

 
6.- 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


7.- 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 log4j.logger.IntroscopeAgent.BrowserAgent=TRACE#com.wily.util.feedback.Log4JSeverityLevel,logfile, reproduce the issue and contact CA Support.
 
8.- 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
 
9.- 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
 
10.- 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