Could not create index / connection refused every minute

Kibana version:
7.10.1
Elasticsearch version:
7.10.1
APM Server version:
7.10.1
APM Agent language and version:
Language : Java
Version : 1.9

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

I've a spring boot application (Docker , OS : Linux) , i use apm to trace evry transaction

Provide logs and/or server output (if relevant):
evrey one minutes , i see these two errors : :confused:

2021-03-09 16:21:58.118 ERROR 1 --- [trics-publisher] i.m.elastic.ElasticMeterRegistry         : could not create index in elastic




java.net.ConnectException: Connection refused (Connection refused)


	at java.net.PlainSocketImpl.socketConnect(Native Method)


	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)


	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)


	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)


	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)


	at java.net.Socket.connect(Socket.java:589)


	at sun.net.NetworkClient.doConnect(NetworkClient.java:175)


	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)


	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)


	at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)


	at sun.net.www.http.HttpClient.New(HttpClient.java:339)


	at sun.net.www.http.HttpClient.New(HttpClient.java:357)


	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)


	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)


	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)


	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)


	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)


	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)


	at io.micrometer.core.ipc.http.HttpUrlConnectionSender.send(HttpUrlConnectionSender.java:55)


	at io.micrometer.core.ipc.http.HttpSender$Request$Builder.send(HttpSender.java:284)


	at io.micrometer.elastic.ElasticMeterRegistry.createIndexIfNeeded(ElasticMeterRegistry.java:101)


	at io.micrometer.elastic.ElasticMeterRegistry.publish(ElasticMeterRegistry.java:128)


	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)


	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)


	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)


	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)


	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)


	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)


	at java.lang.Thread.run(Thread.java:748)




2021-03-09 16:21:58.124 ERROR 1 --- [trics-publisher] i.m.elastic.ElasticMeterRegistry         : failed to send metrics to elastic




java.net.ConnectException: Connection refused (Connection refused)


	at java.net.PlainSocketImpl.socketConnect(Native Method)


	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)


	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)


	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)


	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)


	at java.net.Socket.connect(Socket.java:589)


	at sun.net.NetworkClient.doConnect(NetworkClient.java:175)


	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)


	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)


	at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)


	at sun.net.www.http.HttpClient.New(HttpClient.java:339)


	at sun.net.www.http.HttpClient.New(HttpClient.java:357)


	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)


	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)


	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)


	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)


	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)


	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)


	at io.micrometer.core.ipc.http.HttpUrlConnectionSender.send(HttpUrlConnectionSender.java:55)


	at io.micrometer.core.ipc.http.HttpSender$Request$Builder.send(HttpSender.java:284)


	at io.micrometer.elastic.ElasticMeterRegistry.publish(ElasticMeterRegistry.java:149)


	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)


	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)


	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)


	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)


	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)


	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)


	at java.lang.Thread.run(Thread.java:748)

curl http://apmip:8200 from my app container work fine
i see every transaction from / to my app using Kibana

This is not related to the APM agent, it is a micrometer meter registry implementation that publishes metrics to Elasticsearch. Its configuration should contain a valid address for an accessible Elasticsearch cluster and not for the APM Server.

However, if you upgrade your Java agent to the latest version, you can use any other meter registry and the agent will ship your micrometer metrics instead to Elasticsearch, through the APM Server.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.