Hi,
I've got metricbeat:5.3.0 happily pumping host data (system module) directly to elasticsearch:5.3.0 within a docker swarm (swarm mode), but I'm having difficulty getting the metricbeat docker module to work (I have dockbeat:latest happily pushing data too).
When I run the config below I see records in kabana:5.3.0 from the metricbeat docker module like this:
{
"_index": "metricbeat-2017.04.12",
"_type": "metricsets",
"_id": "AVtjJnaoXM4f8Yh2ACrG",
"_score": null,
"_source": {
"@timestamp": "2017-04-12T17:11:56.783Z",
"beat": {
"hostname": "4d21d0c403c4",
"name": "4d21d0c403c4",
"version": "5.3.0"
},
"docker": {
"container": {}
},
"error": "Get http://unix.sock/containers/json?: dial unix /var/run/docker.sock: connect: permission denied",
"metricset": {
"host": "/var/run/docker.sock",
"module": "docker",
"name": "container",
"rtt": 849
},
"type": "metricsets"
},
"fields": {
"@timestamp": [
1492017116783
]
},
"highlight": {
"metricset.module": [
"@kibana-highlighted-field@docker@/kibana-highlighted-field@"
]
},
"sort": [
1492017116783
]
}
...and in the metricbeat log:
2017/04/12 17:14:46.673063 metrics.go:39: INFO Non-zero metrics in the last 30s: fetches.docker-container.events=3 fetches.docker-container.failures=3 fetches.docker-cpu.events=3 fetches.docker-cpu.failures=3 fetches.docker-diskio.events=3 fetches.docker-diskio.failures=3 fetches.docker-healthcheck.events=3 fetches.docker-healthcheck.failures=3 fetches.docker-info.events=3 fetches.docker-info.failures=3 fetches.docker-memory.events=3 fetches.docker-memory.failures=3 fetches.docker-network.events=3 fetches.docker-network.failures=3 fetches.system-cpu.events=3 fetches.system-cpu.success=3 fetches.system-filesystem.events=249 fetches.system-filesystem.success=3 fetches.system-memory.events=3 fetches.system-memory.success=3 fetches.system-network.events=9 fetches.system-network.success=3 fetches.system-process.events=615 fetches.system-process.success=3 libbeat.es.call_count.PublishEvents=22 libbeat.es.publish.read_bytes=10525 libbeat.es.publish.write_bytes=840459 libbeat.es.published_and_acked_events=900 libbeat.publisher.messages_in_worker_queues=900 libbeat.publisher.published_events=900
here's the snippet from my docker-compose.yml:
metricbeat:
image: docker.elastic.co/beats/metricbeat:5.3.0
volumes:
- /proc:/hostfs/proc:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
- /:/hostfs:ro
- /var/run/docker.sock:/var/run/docker.sock
networks:
- logging
deploy:
mode: global
secrets:
- metricbeat_yml
command: metricbeat -e -c /run/secrets/metricbeat_yml -system.hostfs=/hostfs
secrets:
metricbeat_yml:
file: metricbeat.yml
and my metricbeat.yml:
metricbeat.modules:
- module: system
metricsets:
- cpu
- filesystem
- memory
- network
- process
enabled: true
period: 10s
processes: ['.*']
cpu_ticks: false
- module: docker
metricsets:
- container
- cpu
- diskio
- healthcheck
- info
- memory
- network
hosts: ["unix:///var/run/docker.sock"]
enabled: true
period: 10s
output.elasticsearch:
hosts: ["elasticsearch:9200"]
I know this module is in beta, but when I look at the documentation page the example config is commented out which seems kind of strange to me: https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-docker.html
I think I must be doing something stupid...