Hi,
I'm running metricbeat in a docker container. I'm unable to see the host's metrics in the dashboard (e.g. cpu usage, memory, etc.).
Below is what i have in my docker compose file in terms of volume mounts and flags:
metricbeat:
image: metricbeat
user: root
restart: on-failure
networks:
- mynet
volumes:
- /proc:/hostfs/proc:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
- /:/hostfs:ro
- /var/run/docker.sock:/var/run/docker.sock
environment:
- ELASTICSEARCH_HOST=http://elasticsearch:9200
- KIBANA_HOST=https://kibana:5001
command: ["--strict.perms=false", "-system.hostfs=/hostfs", "-"]
depends_on:
- elasticsearch
And here are the contents of my metricbeat.yml:
#-------------------------------- Autodiscovery -------------------------------
metricbeat.autodiscover:
providers:
- type: docker
templates:
- condition.contains:
docker.container.image: redis
config:
- module: redis
metricsets: ["info", "keyspace"]
hosts: "${data.host}:${data.port}"
metricbeat.modules:
#------------------------------- System Module -------------------------------
- module: system
metricsets: ["cpu", "load", "memory", "network", "process", "process_summary", "core", "diskio", "socket"]
processes: ['.*']
process.include_top_n:
by_cpu: 5
by_memory: 5
period: 10s
cpu.metrics: ["percentages"]
core.metrics: ["percentages"]
- module: system
period: 1m
metricsets:
- filesystem
- fsstat
processors:
- drop_event.when.regexp:
system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host|lib)($|/)'
- module: system
period: 15m
metricsets:
- uptime
#------------------------------- Docker Module -------------------------------
- module: docker
metricsets: ["container", "cpu", "diskio", "healthcheck", "info", "memory", "network"]
hosts: ["unix:///var/run/docker.sock"]
period: 10s
#------------------------------- Processors -------------------------------
processors:
- add_docker_metadata: ~
- add_cloud_metadata: ~
- add_locale: ~
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
hosts: ["http://elasticsearch:9200"]
xpack.monitoring:
enabled: true
elasticsearch:
#============================== Dashboards =====================================
# These settings control loading the sample dashboards to the Kibana index.
# Loading the dashboards is disabled by default and can be enabled either by setting the options here, or by using the `-setup` CLI flag.
setup.dashboards:
enabled: true
setup.dashboards.retry.enabled: true
setup.kibana:
host: "https://kibana:5601"
protocol: "https"
ssl.enabled: true
ssl.certificate_authorities: ["/usr/share/metricbeat/certs/ca.crt"]
ssl.certificate: "/usr/share/metricbeat/certs/kibana.crt"
ssl.key: "/usr/share/metricbeat/certs/kibana.key"
Does anything look wrong to you? Am I missing something? Your help is much appreciated.
Thanks,
Jas