Skip to content

Instantly share code, notes, and snippets.

@kelvintaywl
Created April 13, 2023 06:57
Show Gist options
  • Save kelvintaywl/8591b0ae1c289bfe3951b4642638bd01 to your computer and use it in GitHub Desktop.
Save kelvintaywl/8591b0ae1c289bfe3951b4642638bd01 to your computer and use it in GitHub Desktop.
Telegraf custom config

This output of the Telegraf custom config is from a Server 4.x setup where my telegraf.config.custom_config_file is set to empty string.

# parse and save Telegraf config as TOML
$ kubectl -n circleci get cm/telegraf-custom-config -o=yaml | yq '.data."telegraf_custom.conf"' > default.toml

# run through a TOML linter

$ docker run -i ghcr.io/pelletier/go-toml:v2 tomll < default.toml
[agent]
collection_jitter = '0s'
debug = false
flush_interval = '10s'
flush_jitter = '0s'
hostname = '$HOSTNAME'
interval = '30s'
logfile = ''
metric_batch_size = 1000
metric_buffer_limit = 10000
omit_hostname = true
precision = ''
quiet = false
round_interval = true

[inputs]
[[inputs.internal]]
collect_memstats = false

[[inputs.statsd]]
datadog_extensions = true
metric_separator = '.'
percentile_limit = 1000
percentiles = [50, 95, 99]
service_address = ':8125'

[outputs]
[[outputs.file]]
files = ['stdout']

[[outputs.prometheus_client]]
listen = ':9273'
path = '/metrics'

[processors]
[[processors.enum]]
[[processors.enum.mapping]]
dest = 'status_code'
field = 'status'

[processors.enum.mapping.value_mappings]
critical = 3
healthy = 1
problem = 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment