Metricbeat/statsd server not forwarding data from statsd client

I'm running an ELK container and a separate metricbeats container on the same host, using a bridge network.

The default metricbeats config successfully delivers "system" module metrics, so I know the containers are working as expected.

I am unable to get metricbeats to report any statsd metrics. The following command (and variations) produces no metrics sent to ELK, whether invoked from the host or within the metricbeats container.

echo "my_counter:10|c" | nc -w 1 -u localhost 8125

I've tried other ports to rule that out as an issue. Unfortunately the underlying statsd code doesn't have any relevant logging, so enabling debug doesn't show anything useful. The log indicates the port is bound and the statsd server is running (there is a statsd failure message if it fails to start up).

I've gone over the setup instructions many times, but I can't find any statsd.* information in the Kibana UI.

Relevant config:

logging.level: debug
logging.selectors: [ "*" ]
#logging.metrics.enabled: true
#logging.metrics.period: 10s

output.elasticsearch:

  hosts: ["elk:9200"]

setup.kibana:

  host: "elk:5601"

metricbeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.period: 10s
  reload.enabled: true

metricbeat.modules:

- module: statsd
  host: localhost
  port: 8125
  metricsets:
    - server
  enabled: true
  period: 1s

Turns out that the container was not properly resolving "localhost". Changing the nc command to use 127.0.0.1 instead resolved the issue for transmitting from within the container.

1 Like

Thanks for sharing your solution, @technomage. Let us know if you need any further help here.