I believe the following answer resolves it: How to use Metricbeat to monitor Docker Swarm containers, hosts and external services
The accepted solution is to run metricsbeat in global mode with a set of paths as mounted volumes: https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-docker.html#_volume_mounted_configuration