1.0.0, 1.0, 1, latest (Dockerfile)Telegraf is an agent written in Go for collecting metrics from the system it's running on, or from other services, and writing them into InfluxDB or other outputs.
Telegraf comes with no input and output configuration so we have to create one.
We can create a full telegraf.conf configuration file and configure the required inputs and outputs.
$ docker run -it --rm jfusterm/telegraf telegraf -sample-config > telegraf.conf
Another approach is to generate the configuration with just the inputs and outputs we need. For example with Docker and Nginx inputs and InfluxDB output.
$ docker run -it --rm jfusterm/telegraf telegraf -sample-config -input-filter docker:nginx -output-filter influxdb > telegraf.conf
Note: For a detailed list of the input and output plugins, check the Github repository.
DockerfileFROM jfusterm/telegraf
COPY telegraf.conf /etc/telegraf
$ docker build -t my-telegraf .
$ docker run -d --name my-telegraf my-telegraf
telegraf.conf to the container$ docker create --name telegraf jfusterm/telegraf
$ docker cp telegraf.conf telegraf:/etc/telegraf
$ docker start telegraf
$ docker run --name telegraf -v /dir/telegraf.conf:/etc/telegraf/telegraf.conf jfusterm/telegraf
Content type
Image
Digest
Size
15.3 MB
Last updated
about 10 years ago
docker pull jfusterm/telegraf