Last active
August 10, 2020 11:36
-
-
Save joseluisq/47d87967fe1745e29a58b1b8fc5873f1 to your computer and use it in GitHub Desktop.
How to run InfluxData Telegraf using Docker compose in order to collect host and containers metrics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
telegraf: | |
image: telegraf:1.14-alpine | |
environment: | |
HOST_ETC: /hostfs/etc | |
HOST_PROC: /hostfs/proc | |
HOST_SYS: /hostfs/sys | |
HOST_MOUNT_PREFIX: /hostfs | |
volumes: | |
- /etc/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro | |
- /var/run/docker.sock:/var/run/docker.sock:ro | |
- /var/run/docker.pid:/var/run/docker.pid:ro | |
- /:/hostfs:ro | |
- /etc:/hostfs/etc:ro | |
- /proc:/hostfs/proc:ro | |
- /sys:/hostfs/sys:ro | |
- /var/run/utmp:/var/run/utmp:ro | |
deploy: | |
replicas: 1 | |
update_config: | |
parallelism: 1 | |
delay: 10s | |
restart_policy: | |
condition: on-failure | |
networks: | |
- telegraf-net | |
- other-net | |
network_mode: host | |
networks: | |
telegraf-net: | |
external: true | |
other-net: | |
external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment