The Telegraf Toolbelt
It can do that, really?
David McKay
Developer Advocate
at InfluxData
@rawkode
🏴󠁧󠁢󠁳󠁣󠁴󠁿 Scottish
🐭 Has Pets
💙 Esoteric Programming Languages
☸ Kubernetes Release Team
The Plugin Ecosystem
Establishing a Base Line
© InfluxData. All rights reserved.
Over Plugins
➔ 169 Inputs
➔ 35 Outputs
➔ 15 Processors
➔ 14 Parsers
➔ 9 Serializers
➔ 8 Aggregators
© InfluxData. All rights reserved.
V . (May)
➔ Inputs
◆ Google Cloud PubSub
◆ Kinesis Consumer
◆ Kube Inventory
◆ Neptune Apex
◆ Nginx Upstream Checks
◆ Multifile
◆ Stack Driver
➔ Outputs
◆ Google Cloud PubSub
➔ Serializers
◆ Nowmetric
◆ Carbon
© InfluxData. All rights reserved.
V . (June)
➔ Inputs
◆ bind
◆ Cisco GNMI
◆ Cisco MDT
◆ ECS & Fargate
◆ GitHub
◆ OpenWeatherMap
◆ PowerDNS
➔ Outputs
◆ Health
◆ Syslog
➔ Serializers
◆ Wavefront
➔ Aggregators
◆ Final
© InfluxData. All rights reserved.
V . (September)
➔ Inputs
◆ apcupsd
◆ Docker Logs
◆ Fireboard
◆ Logstash
◆ MarkLogic
◆ OpenNTPD
◆ uWSGI
➔ Outputs
◆ Exec
➔ Parsers
◆ Form
➔ Processors
◆ Date
◆ Pivot
◆ Unpivot
◆ Tag Limit
© InfluxData. All rights reserved.
There are 3249
telegraf.conf files on
GitHub
© InfluxData. All rights reserved.
I could only get 1000
telegraf.conf files from
GitHub
I used a sample of 1000
telegraf.conf files from
GitHub
Interval
% Use s (Default)
. % use s
% use s
% use m
% use s
Round
Interval
% True
Jitter % None
Omit
Hostname
% False
© InfluxData. All rights reserved.
Output Plugins
➔ 71% 1 Output
➔ 5% 2 Outputs
➔ 2% 0 Outputs
➔ .6% 3 Outputs
© InfluxData. All rights reserved.
Output Plugins
➔ 72% InfluxDB
➔ 5% File
➔ 2% Prometheus Client
➔ .9% Graphite
➔ .6% Kafka
© InfluxData. All rights reserved.
Input Plugins
➔ 17% 1 Input
➔ 12% 9 Inputs
➔ 10% 8 Inputs
➔ 5% 10 Inputs
➔ 5% 11 Inputs
➔ 5% 6 Inputs
➔ 5% 7 Inputs
➔ 1 56 Inputs ?!?!
© InfluxData. All rights reserved.
Input Plugins
➔ 58% CPU
➔ 53% Mem
➔ 52% Disk
➔ 51% System
➔ 47% DiskIO
➔ 47% Swap
➔ 40% Process
➔ 31% Kernel
➔ 28% Docker
➔ 23% Net
12% Invalid
Dual Write to InfluxDB and
Multiple Outputs
. %
© InfluxData. All rights reserved.
Multiple Outputs
[[outputs.influxdb]]
urls = ["http://influxdb: "]
[[outputs.influxdb_v ]]
urls = ["http://influxdb : "]
Fetching Configuration at Runtime
v .
Remote Configuration
© InfluxData. All rights reserved.
Remote Configuration
telegraf --config <http_uri>
© InfluxData. All rights reserved.
Remote Configuration
telegraf --config
https://raw.githubusercontent.com
/influxdata/telegraf/master/etc/telegraf.conf
© InfluxData. All rights reserved.
Remote Configuration
SOME_VAR=abc123 telegraf --config <http_uri>
© InfluxData. All rights reserved.
Remote Configuration
[agent]
interval = “${INTERVAL}”
[[outputs.influxdb_v2]]
token = “${TOKEN}”
Handling failures without losing metrics
v . ( !)
Output Resiliency
© InfluxData. All rights reserved.
Output Resiliency
Use
metric_buffer_limit
to handle downtime of your outputs
© InfluxData. All rights reserved.
InfluxDB
Telegraf
Application
Software
Dependencies
Bare Metal
/
VMs
Network
Buffer Batch
© InfluxData. All rights reserved.
Telegraf
Application
Software
Dependencies
Bare Metal
/
VMs
Network
Buffer Batch
© InfluxData. All rights reserved.
InfluxDB
Telegraf
Application
Software
Dependencies
Bare Metal
/
VMs
Network
Buffer Batch
© InfluxData. All rights reserved.
Output Resiliency
influxdb_listener
http_listener
v . / . % / It was me!
© InfluxData. All rights reserved.
influxdb_listener
Allows Telegraf to serve as a proxy for the /write endpoint of the
InfluxDB HTTP API.
Output Resiliency
influxdb_listener
[[inputs.influxdb_listener]]
service_address = ":8086"
© InfluxData. All rights reserved.
v1 Client Libraries
© InfluxData. All rights reserved.
http_listener_v
Allows Telegraf to accept metrics over HTTP in any supported
format
Output Resiliency
http_listener_v
[[inputs.http_listener_v2]]
service_address = ":8080"
data_format = "json"
JSON
[[inputs.http_listener_v2]]
data_format = "json"
json_name_key = "name"
tag_keys = [“go_version”]
Docs
Cloud Native Telegraf
Bring Your Own Telegraf
Plugins come at a cost
➜ docker image ls
byot-sample 19.3MB
telegraf 254MB
© InfluxData. All rights reserved.
Bring Your Own Telegraf
FROM rawkode/telegraf:byo AS build
FROM alpine:3.7 AS telegraf
COPY --from=build /etc/telegraf /etc/telegraf
COPY --from=build /binary /bin/telegraf
ENTRYPOINT [ "/bin/telegraf" ]
© InfluxData. All rights reserved.
Bring Your Own Telegraf
BYOT
BYOT Example
Click Me! Click Me!
© InfluxData. All rights reserved.
InfluxDB
Telegraf
Application
Software
Dependencies
Bare Metal
/
VMs
Network
Buffer Batch
© InfluxData. All rights reserved.
InfluxDB
Application
Software
Dependencies
Bare Metal
/
VMs
Network
Telegraf
Telegraf
Telegraf
Telegraf
Internal
Telegraf Exposes Metrics Too!
v . / . %
Internal
➔ Keep an eye on buffer_size
➔ Make sure you alert on metrics_dropped
Sophisticated Health Checks
Health Output
v . / %
@app.route("/health")
def healthcheck():
return "OK”
@app.route("/health")
def healthcheck():
return "OK”
© InfluxData. All rights reserved.
Health Output
[[outputs.health]]
service_address = "http://:5559"
namepass = ["web-metrics"]
[[outputs.health.compares]]
field = "response_time"
lt = 0.300
Controlling Ingress
Kafka In, Kafka Out
© InfluxData. All rights reserved.
InfluxDB
Application
Software
Dependencies
Bare Metal
/
VMs
Network
Telegraf
Telegraf
Telegraf
Telegraf
Kafka
Telegraf
Telegraf
Demo
We’ve covered less than
10 of the 200 plugins
@rawkode
Thank you

The Telegraf Toolbelt | David McKay | InfluxData