• By telegraf-charmers
juju deploy cs:~telegraf-charmers/telegraf-k8s
Show information
Channel Version Platform
latest/stable 4
latest/candidate 0



Telegraf charm for Kubernetes Read more

Relevant links

Discuss this charm

Share your thoughts on this charm with the community on discourse.

Join the discussion



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

Telegraf is plugin-driven and has the concept of 4 distinct plugin types: Input Plugins collect metrics from the system, services, or 3rd party APIs Processor Plugins transform, decorate, and/or filter metrics Aggregator Plugins create aggregate metrics (e.g. mean, min, max, quantiles, etc.) Output Plugins write metrics to various destinations

Deploying telegraf in a k8s environment makes sense to monitor services or 3rd party APIs, not to gather system stats (telegraf would only monitor itself in its container).

It is possible for instance to deploy telegraf on k8s to gather metrics about a github repository with the github input plugin, weather data with the OpenWeatherMap input plugin, or check HTTP/HTTPS connections with the http_response plugin.


Deploy the charm to a k8s juju model, for example:

juju deploy cs:~telegraf-charmers/telegraf --config inputs='[[inputs.github]]
  repositories = [

In this case, telegraf will expose its metrics using the charm's default output plugin, prometheus on tcp port 9103.

Using a custom image

By default the charm will use the telegrafcharmers/telegraf:edge image from dockerhub. To build and push a custom image:

git clone
cd charm-k8s-telegraf
make image-build
docker tag telegraf:latest localhost:32000/telegraf
docker push localhost:32000/telegraf

Then, to use your new image, either replace the deploy step above with:

juju deploy ./telegraf.charm --config image_path=localhost:32000/telegraf

or, if you've already deployed telegraf:

juju config telegraf image_path=localhost:32000/telegraf


Just run make test