/
Release H: Telegraf

Release H: Telegraf

Introduction

Telegraf is an agent for collecting, processing, aggregating, and writing metrics.

The telegrapf repository is available here: Telegraf Repository and contains a number of plugins which can be included in your telegraf.conf file.

The following yaml file provides a sample configuration which uses telegraf and docker as input plugins and influx and influx_v2 as output plugins - telegraf.yaml

For the docker input plugin to work we must mount /var/run/docker.sock into our container, we also need to set the security context for the container. To do this follow the instructions below.

Security Context setup
# Setup the telegraf user
sudo useradd -g docker telegraf
sudo passwd telegraf

id telegraf

uid=1001(telegraf) gid=1001(docker) groups=1001(docker)

Log into the container and see what group docker.sock is assigned to
/ $ ls -l /var/run/docker.sock
srw-rw----    1 root     ping             0 Mar 16 07:35 /var/run/docker.sock
# Get the id of the group
/ $ getent group ping
ping:x:999
# We now have the 3 ids we need for the security context
      securityContext:
        runAsUser: 1001
        runAsGroup: 1001
        fsGroup: 999

Change these values in your container if they are different from above.


Our metrics are being collected into the telegraf bucket.

We can now see the visualizations in the influx dashboard we imported using the community templates : Community Templates

Note: You'll need to configure each cell so it's retrieving the docker metrics from the correct bucket, in this case telegraf.


Links

How to Write a Telegraf Plugin for Beginners

Execd Input Plugin

Getting Started with Apache Kafka and InfluxDB


Related content

Release H: Minio Metrics
Release H: Minio Metrics
More like this
Release J - Run in Kubernetes - Additional instructions for RANPM Installation
Release J - Run in Kubernetes - Additional instructions for RANPM Installation
More like this
Release H: Influxdb Security
Release H: Influxdb Security
More like this
How to install the VES Collector?
How to install the VES Collector?
More like this
Release H: Kafka Metrics
Release H: Kafka Metrics
More like this
Release H - Run in Docker
Release H - Run in Docker
More like this