The Telegraf Toolbelt

A presentation at InfuxDays San Francisco 2019 in October 2019 in San Francisco, CA, USA by David McKay

Slide 1

Slide 1

The Telegraf Toolbelt It can do that, really?

Slide 2

Slide 2

David McKay Developer Advocate 🏴󠁧󠁢󠁳󠁣󠁴󠁿 Scottish 🐭 Has 9 Pets at InfluxData 💙 Esoteric Programming Languages @rawkode ☸ Kubernetes Release Team

Slide 3

Slide 3

Establishing a Base Line The Plugin Ecosystem

Slide 4

Slide 4

Over 200 Plugins ➔ 169 ➔ 35 ➔ 15 ➔ 14 ➔ 9 ➔ 8 Inputs Outputs Processors Parsers Serializers Aggregators © 2019 InfluxData. All rights reserved. 4

Slide 5

Slide 5

V1.10 (May) ➔ Inputs ◆ ◆ ◆ ◆ ◆ ◆ ◆ Google Cloud PubSub Kinesis Consumer Kube Inventory Neptune Apex Nginx Upstream Checks Multifile Stack Driver ➔ Outputs ◆ Google Cloud PubSub ➔ Serializers © 2019 InfluxData. All rights reserved. ◆ ◆ Nowmetric Carbon2 5

Slide 6

Slide 6

V1.11 (June) ➔ Inputs ◆ ◆ ◆ ◆ ◆ ◆ ◆ bind9 Cisco GNMI Cisco MDT ECS & Fargate GitHub OpenWeatherMap PowerDNS ➔ Outputs ◆ ◆ Health Syslog ➔ Serializers ◆ ➔ © 2019 InfluxData. All rights reserved. Wavefront Aggregators ◆ Final 6

Slide 7

Slide 7

V1.12 (September) ➔ Inputs ◆ ◆ ◆ ◆ ◆ ◆ ◆ apcupsd Docker Logs Fireboard Logstash MarkLogic OpenNTPD uWSGI ➔ Outputs ◆ Exec ➔ Parsers ◆ ➔ © 2019 InfluxData. All rights reserved. Form Processors ◆ Date ◆ Pivot ◆ Unpivot ◆ Tag Limit 7

Slide 8

Slide 8

© 2019 InfluxData. All rights reserved. 8

Slide 9

Slide 9

There are 3249 telegraf.conf files on GitHub

Slide 10

Slide 10

© 2019 InfluxData. All rights reserved. 10

Slide 11

Slide 11

I could only get 1000 telegraf.conf files from GitHub

Slide 12

Slide 12

I used a sample of 1000 telegraf.conf files from GitHub

Slide 13

Slide 13

73% Use 10s (Default) 5.6% use 1s Interval 4% use 5s 2% use 1m 1% use 30s

Slide 14

Slide 14

Round Interval 90% True

Slide 15

Slide 15

Jitter 90% None

Slide 16

Slide 16

Omit Hostname 90% False

Slide 17

Slide 17

Output Plugins ➔ ➔ ➔ ➔ 71% 5% 2% .6% 1 2 0 3 Output Outputs Outputs Outputs © 2019 InfluxData. All rights reserved. 17

Slide 18

Slide 18

Output Plugins ➔ ➔ ➔ ➔ ➔ 72% 5% 2% .9% .6% InfluxDB File Prometheus Client Graphite Kafka © 2019 InfluxData. All rights reserved. 18

Slide 19

Slide 19

Input Plugins ➔ ➔ ➔ ➔ ➔ ➔ ➔ ➔ 17% 12% 10% 5% 5% 5% 5% 1 1 9 8 10 11 6 7 56 Input Inputs Inputs Inputs Inputs Inputs Inputs Inputs ?!?! © 2019 InfluxData. All rights reserved. 19

Slide 20

Slide 20

Input Plugins ➔ ➔ ➔ ➔ ➔ 58% 53% 52% 51% 47% CPU Mem Disk System DiskIO ➔ ➔ ➔ ➔ ➔ © 2019 InfluxData. All rights reserved. 47% 40% 31% 28% 23% Swap Process Kernel Docker Net 20

Slide 21

Slide 21

12% Invalid

Slide 22

Slide 22

Multiple Outputs Dual Write to InfluxDB 1 and 2 5.6%

Slide 23

Slide 23

Multiple Outputs [[outputs.influxdb]] urls = [“http://influxdb:8086”] [[outputs.influxdb_v2]] urls = [“http://influxdb2:9999”] © 2019 InfluxData. All rights reserved. 23

Slide 24

Slide 24

Remote Configuration Fetching Configuration at Runtime v1.10

Slide 25

Slide 25

Remote Configuration telegraf —config <http_uri> © 2019 InfluxData. All rights reserved. 25

Slide 26

Slide 26

Remote Configuration telegraf —config https://raw.githubusercontent.com /influxdata/telegraf/master/etc/telegraf.conf © 2019 InfluxData. All rights reserved. 26

Slide 27

Slide 27

Remote Configuration SOME_VAR=abc123 telegraf —config <http_uri> © 2019 InfluxData. All rights reserved. 27

Slide 28

Slide 28

Remote Configuration [agent] interval = “${INTERVAL}” [[outputs.influxdb_v2]] token = “${TOKEN}” © 2019 InfluxData. All rights reserved. 28

Slide 29

Slide 29

Output Resiliency Handling failures without losing metrics v0.10 (2015!)

Slide 30

Slide 30

Output Resiliency Use metric_buffer_limit to handle downtime of your outputs © 2019 InfluxData. All rights reserved. 30

Slide 31

Slide 31

Application Software Dependencies Bare Metal / VMs InfluxDB Buffer Batch Network Telegraf © 2019 InfluxData. All rights reserved. 31

Slide 32

Slide 32

Application Software Dependencies Bare Metal / VMs Buffer Batch Network Telegraf © 2019 InfluxData. All rights reserved. 32

Slide 33

Slide 33

Application Software Dependencies Bare Metal / VMs InfluxDB Buffer Batch Network Telegraf © 2019 InfluxData. All rights reserved. 33

Slide 34

Slide 34

Output Resiliency influxdb_listener http_listener v1.9 / 0.01% / It was me! © 2019 InfluxData. All rights reserved. 34

Slide 35

Slide 35

Output Resiliency influxdb_listener Allows Telegraf to serve as a proxy for the /write endpoint of the InfluxDB HTTP API. © 2019 InfluxData. All rights reserved. 35

Slide 36

Slide 36

[[inputs.influxdb_listener]] influxdb_listener service_address = “:8086”

Slide 37

Slide 37

© 2019 InfluxData. All rights reserved. 37

Slide 38

Slide 38

v1 Client Libraries

Slide 39

Slide 39

Output Resiliency http_listener_v2 Allows Telegraf to accept metrics over HTTP in any supported format © 2019 InfluxData. All rights reserved. 39

Slide 40

Slide 40

[[inputs.http_listener_v2]] http_listener_v2 service_address = “:8080” data_format = “json”

Slide 41

Slide 41

[[inputs.http_listener_v2]] data_format = “json” JSON Docs json_name_key = “name” tag_keys = [“go_version”]

Slide 42

Slide 42

Bring Your Own Telegraf Cloud Native Telegraf

Slide 43

Slide 43

Plugins come at a cost

Slide 44

Slide 44

➜ docker image ls byot-sample telegraf 19.3MB 254MB

Slide 45

Slide 45

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” ] © 2019 InfluxData. All rights reserved. 45

Slide 46

Slide 46

Bring Your Own Telegraf BYOT BYOT Example Click Me! Click Me! © 2019 InfluxData. All rights reserved. 46

Slide 47

Slide 47

Application Software Dependencies Bare Metal / VMs InfluxDB Buffer Batch Network Telegraf © 2019 InfluxData. All rights reserved. 47

Slide 48

Slide 48

InfluxDB Application Telegraf © 2019 InfluxData. All rights reserved. Telegraf Software Dependencies Telegraf Bare Metal / VMs Telegraf Network 48

Slide 49

Slide 49

Internal Telegraf Exposes Metrics Too! v1.2 / 0.1%

Slide 50

Slide 50

Internal ➔ Keep an eye on buffer_size ➔ Make sure you alert on metrics_dropped

Slide 51

Slide 51

Health Output Sophisticated Health Checks v1.11 / 0%

Slide 52

Slide 52

@app.route(“/health”) def healthcheck(): return “OK”

Slide 53

Slide 53

@app.route(“/health”) def healthcheck(): return “OK”

Slide 54

Slide 54

Health Output [[outputs.health]] service_address = “http://:5559” namepass = [“web-metrics”] [[outputs.health.compares]] field = “response_time” lt = 0.300 © 2019 InfluxData. All rights reserved. 54

Slide 55

Slide 55

Kafka In, Kafka Out Controlling Ingress

Slide 56

Slide 56

InfluxDB Telegraf Telegraf Software Dependencies Telegraf Bare Metal / VMs Kafka Telegraf Application Telegraf © 2019 InfluxData. All rights reserved. Telegraf Network 56

Slide 57

Slide 57

Demo

Slide 58

Slide 58

We’ve covered less than 10 of the 200 plugins

Slide 59

Slide 59

Thank you @rawkode