nicolargo/docker-influxdb-grafana

What is the purpose of telegraf ?

filviu opened this issue · 3 comments

I'm a bit new to the docker world and I'm trying to wrap my head around it:

Wouldn't this stack only colect metrics from inside the telegraf container?

Thanks!

Purpose of Telegraf is the scheduling of data collectors - standard and custom that you can write.

I found the free tutorial by Mark Takacs to be a great way to understand the Docker world.

By default, a containerized Telegraf would only see data inside the container it is running in. However, Docker allows the mapping of ports and volumes from the host to the container - this is also how data persistency is achieved.

I think you are right that the way docker-compose.yml is currently written, Telegraf wouldn't see anything outside its own container, because no mapping of ports or volumes has been configured (except for the volume which only gives access to the ./telegraf.conf on the host)

telegraf:
  image: telegraf:latest
  container_name: telegraf
  links:
    - influxdb
  volumes:
    - ./telegraf.conf:/etc/telegraf/telegraf.conf:ro

Depending on one's particular monitoring needs, the mapping will have to be extended.

Thank you, that makes sense.

Feel free to close the issue