Unable to connect CloudFoundry application to CA APM

Document ID : KB000105985
Last Modified Date : 23/07/2018
Show Technical Document Details
Issue:
Deploy a java application on cloud foundry (see documentation
https://docops.ca.com/ca-apm/10-5/en/implementing-agents/java-agent/install-the-java-agent/deploy-and-monitor-a-java-application-on-cloud-foundry )
but when the application starts , it cannot connect to the Enterprise Manager . 

From the Agent logs file (in CloudFoundry container), note the following error :
   ...[WARN] [IntroscopeAgent.ConnectionThread] Failed to connect to the Introscope Enterprise Manager   at <my Url Hidden>:80,com.wily.isengard.postofficehub.link.net.HttpTunnelingSocketFactory 
   (Connection refused (Connection refused)).:80,com.wily.isengard.postofficehub.link.net.HttpTunnelingSocketFactory (Connection refused (Connection refused)).
Environment:
APM 10.5.x
Cause:
from the documentation , there is no way to configure the port connection with the Enterprise Manager
Resolution:
The following command is a bit different than the one on the docops link. 
Run the following command :

#### 
Create the Introscope Service 
Create the user-provided service that is named introscope. 

Follow these steps: 
Provide the host name and port for the Enterprise Manager. 
The Introscope agent requires these values to connect to the Enterprise Manager. 

At a command prompt, run this command: 
$ cf cups introscope -p "host-name,port" 
When prompted, type the Enterprise Manager host name, and press Enter. 
When prompted, provide the port, and press Enter. 
#### 

or

Add the right port number to the Url -DagentManager.url.1=http://<hidden-url>:<rightPort>
( from file IntroscopeAgent.properties)