Error trying to connect to APM Server

Kibana version:

Elasticsearch version:

APM Server version:

APM Agent language and version:
Java, 1.30.1

Fresh install or upgraded from other version?

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
I have spring boot project with apm-agent dependency, i started my app but there is error - Connection refused, I cannot connect to APM server. Also i'm thinking about apm server certificate, should I add it somewhere?
init function:


Provide logs and/or server output (if relevant):
ERROR - Error trying to connect to APM Server at http://localhost:8200/intake/v2/events. Although not necessarily related to SSL, some related SSL configurations corresponding the current connection are logged at INFO level.
ERROR - Failed to handle event of type JSON_WRITER with this error: Connection refused (Connection refused) Connection refused (Connection refused)

Hi and welcome to our forum :wave:

Since you are using HTTP to communicate with the APM Server, it shouldn't be related to SSL/TLS.
Most likely the APM Server is not reachable at http://localhost:8200 from your application host. Try curl to verify it is accessible from where the agent is deployed first.
Also, check out our troubleshooting guide.

If you did add the agent as a dependency, then you should remove it. If you added the apm-agent-attach as a dependency, then that's OK.

Make sure to go over our setup guide and the rest of the agent documentation.
I hope you can find most answers there, let us know if not.

Hello again,
So maybe I will share my configuration with more details.
I'm using maven,java and spring
This is my apm-agent attach dependency:
Checking with guide I also have

Here i got my Config:

In which i have method with attaching properties:

And I still have my problem


And if i change to HTTPS connection where I should add my certs considering I'm using agent attach dependency in spring boot? :slight_smile:

Seriously, check out our docs, they are a good resource