APM Server Docker instance - metricbeat not able to see stats

When following the steps here

for my docker instance of apm-server I can't get the local machine to cUrl the exposed http port.

On the container I can curl localhost:5067/stats and get a JSON returned, but when I try on the host (where metricbeat is running) I get

curl -v http://127.0.0.1:5067/stats
* About to connect() to 127.0.0.1 port 5067 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 5067 (#0)
> GET /stats HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1:5067
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

Any suggestions?

relevant apm.yml configs:

apm-server:
  # Defines the host and port the server is listening on. Use "unix:/path/to.sock" to listen on a unix domain socket.
  host: "apm01.helcim.com:8200"
# Defines if the HTTP endpoint is enabled.
http.enabled: true

# The HTTP endpoint will bind to this hostname or IP address. It is recommended to use only localhost.
http.host: 127.0.0.1

# Port on which the HTTP endpoint will bind. Default is 5066.
http.port: 5067
monitoring.enabled: false

Container Summary:

ONTAINER ID        IMAGE                                                  COMMAND                  CREATED             STATUS                 PORTS                                            NAMES
669b0bc0a325        docker.elastic.co/apm/apm-server:7.12.0                "/usr/bin/tini -- /u…"   27 minutes ago      Up 27 minutes          0.0.0.0:5067->5067/tcp, 0.0.0.0:8200->8200/tcp   apm01.helcim.com

Also, when trying to connect over https instead I get

* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* NSS error -12263 (SSL_ERROR_RX_RECORD_TOO_LONG)
* SSL received a record that exceeded the maximum permissible length.
* Closing connection 0
curl: (35) SSL received a record that exceeded the maximum permissible length.

Fixed this by changing http.host: 127.0.0.1 to http.host: apm01.helcim.com (name of the container) and then I was able to curl from the host machine.

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