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
* About to connect() to port 5067 (#0)
*   Trying
* Connected to ( port 5067 (#0)
> GET /stats HTTP/1.1
> User-Agent: curl/7.29.0
> Host:
> Accept: */*
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

Any suggestions?

relevant apm.yml configs:

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

# 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>5067/tcp,>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
* 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: 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.