Merge the defaults and pillar for telegraf

This commit is contained in:
Mike Reeves
2022-12-15 13:28:29 -05:00
parent d37a4b14ca
commit e55086230d
3 changed files with 52 additions and 11 deletions

View File

@@ -1,3 +1,10 @@
telegraf:
config:
interval: '30s'
interval: '30s'
metric_batch_size: 1000
metric_buffer_limit: 10000
collection_jitter: '0s'
flush_interval: '10s'
flush_jitter: '0s'
debug: 'false'
quiet: 'false'

View File

@@ -7,8 +7,7 @@
{%- set UNIQUEID = salt['pillar.get']('sensor:uniqueid', '') %}
{%- set ZEEK_ENABLED = salt['pillar.get']('zeek:enabled', True) %}
{%- set MDENGINE = GLOBALS.md_engine %}
{%- set TGCMERGED = salt['pillar.get']('telegraf', TGDEFAULTS, merge=true) %}
# Global tags can be specified here in key="value" format.
[global_tags]
role = "{{ GLOBALS.role.split('-') | last }}"
@@ -16,7 +15,7 @@
# Configuration for telegraf agent
[agent]
## Default data collection interval for all inputs
interval = "{{ TGDEFAULTS.telegraf.config.interval }}"
interval = "{{ TGMERGED.telegraf.config.interval }}"
## Rounds collection interval to 'interval'
## ie, if interval="10s" then always collect on :00, :10, :20, etc.
round_interval = true
@@ -24,27 +23,27 @@
## Telegraf will send metrics to outputs in batches of at most
## metric_batch_size metrics.
## This controls the size of writes that Telegraf sends to output plugins.
metric_batch_size = 1000
metric_batch_size = {{ TGMERGED.telegraf.config.metric_batch_size }}
## For failed writes, telegraf will cache metric_buffer_limit metrics for each
## output, and will flush this buffer on a successful write. Oldest metrics
## are dropped first when this buffer fills.
## This buffer only fills when writes fail to output plugin(s).
metric_buffer_limit = 10000
metric_buffer_limit = {{ TGMERGED.telegraf.config.metric_buffer_limit }}
## Collection jitter is used to jitter the collection by a random amount.
## Each plugin will sleep for a random time within jitter before collecting.
## This can be used to avoid many plugins querying things like sysfs at the
## same time, which can have a measurable effect on the system.
collection_jitter = "0s"
collection_jitter = "{{ TGMERGED.telegraf.config.collection_jitter }}"
## Default flushing interval for all outputs. Maximum flush_interval will be
## flush_interval + flush_jitter
flush_interval = "10s"
flush_interval = "{{ TGMERGED.telegraf.config.flush_interval }}"
## Jitter the flush interval by a random amount. This is primarily to avoid
## large write spikes for users running a large number of telegraf instances.
## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
flush_jitter = "0s"
flush_jitter = "{{ TGMERGED.telegraf.config.flush_jitter }}"
## By default or when set to "0s", precision will be set to the same
## timestamp order as the collection interval, with the maximum being 1s.
@@ -57,7 +56,7 @@
## Logging configuration:
## Run telegraf with debug log messages.
debug = false
debug = {{ TGMERGED.telegraf.config.debug }}
## Run telegraf in quiet mode (error log messages only).
quiet = false
## Specify the log file name. The empty string means to log to stderr.

View File

@@ -3,4 +3,39 @@ telegraf:
interval:
description: Data collection interval.
global: True
helpLink: telegraf.html
helpLink: telegraf.html
metric_batch_size:
description: Data collection batch size.
global: True
advanced: True
helpLink: telegraf.html
metric_buffer_limit:
description: Data collection buffer size.
global: True
advanced: True
helpLink: telegraf.html
collection_jitter:
description: Jitter of the flush interval.
global: True
advanced: True
helpLink: telegraf.html
flush_interval:
description: Flush interval for all outputs.
global: True
advanced: True
helpLink: telegraf.html
flush_jitter:
description: Jitter the flush interval.
global: True
advanced: True
helpLink: telegraf.html
debug:
description: Data collection interval.
global: True
advanced: True
helpLink: telegraf.html
quiet:
description: Data collection interval.
global: True
helpLink: telegraf.html