Sign inSign up

jfusterm/telegraf

By jfusterm

•Updated about 10 years ago

Alpine image with Telegraf

Image
0

2.9K

jfusterm/telegraf repository overview

⁠Tags & Dockerfile

⁠What is Telegraf?

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.

⁠Usage

⁠Create the configuration file

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⁠.

⁠Create the container
⁠Use your own image
  • Create a Dockerfile
FROM jfusterm/telegraf
COPY telegraf.conf /etc/telegraf
  • Build the image
$ docker build -t my-telegraf .
  • Run the container
$ docker run -d --name my-telegraf my-telegraf
⁠Copy the telegraf.conf to the container
  • Create the container
$ docker create --name telegraf jfusterm/telegraf
  • Copy the configuration file to the container
$ docker cp telegraf.conf telegraf:/etc/telegraf
  • Start the container
$ docker start telegraf
⁠Bind mount the configuration file
$ docker run --name telegraf -v /dir/telegraf.conf:/etc/telegraf/telegraf.conf jfusterm/telegraf

Tag summary

Content type

Image

Digest

Size

15.3 MB

Last updated

about 10 years ago

docker pull jfusterm/telegraf