# APM Server Docker instance - metricbeat not able to see stats

**URL:** <https://discuss.elastic.co/t/apm-server-docker-instance-metricbeat-not-able-to-see-stats/270414>\
**Category:** APM\
**Tags:** elastic-stack-monitoring, docker, server\
**Created:** [April 16, 2021, 6:47pm UTC](https://discuss.elastic.co/t/apm-server-docker-instance-metricbeat-not-able-to-see-stats/270414 "2021-04-16T18:47:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![doyelese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/doyelese/32/82871_2.png) [@doyelese](https://discuss.elastic.co/u/doyelese)\
**Post date:** [April 16, 2021, 6:47pm UTC](https://discuss.elastic.co/t/apm-server-docker-instance-metricbeat-not-able-to-see-stats/270414/1 "2021-04-16T18:47:28Z")

</div>

When following the steps here

> **[Use Metricbeat to send monitoring data | APM Server Reference \[7.12\] | Elastic](https://www.elastic.co/guide/en/apm/server/current/monitoring-metricbeat-collection.html)**

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

```auto
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:

```auto
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"

```

```auto
# 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

```

```auto
monitoring.enabled: false

```

Container Summary:

```auto
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

```auto
* 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.

```

---

<div class="post-metadata">

**Author:** ![doyelese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/doyelese/32/82871_2.png) [@doyelese](https://discuss.elastic.co/u/doyelese)\
**Post date:** [April 16, 2021, 7:28pm UTC](https://discuss.elastic.co/t/apm-server-docker-instance-metricbeat-not-able-to-see-stats/270414/2 "2021-04-16T19:28:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 7, 2021, 3:28pm UTC](https://discuss.elastic.co/t/apm-server-docker-instance-metricbeat-not-able-to-see-stats/270414/3 "2021-05-07T15:28:45Z")

</div>

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