-
Notifications
You must be signed in to change notification settings - Fork 4
/
telegraf.conf
248 lines (194 loc) · 9.65 KB
/
telegraf.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# Telegraf Configuration
#
# Telegraf is entirely plugin driven. All metrics are gathered from the
# declared inputs, and sent to the declared outputs.
#
# Plugins must be declared in here to be active.
# To deactivate a plugin, comment out the name and any variables.
#
# Use 'telegraf -config telegraf.conf -test' to see what metrics a config
# file would generate.
#
# Environment variables can be used anywhere in this config file, simply surround
# them with ${}. For strings the variable must be within quotes (ie, "${STR_VAR}"),
# for numbers and booleans they should be plain (ie, ${INT_VAR}, ${BOOL_VAR})
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# GLOBAL CONFIGURATION #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Global tags can be specified here in key="value" format.
[global_tags]
machine_id = "$TELEGRAF_MACHINE"
# Configuration for telegraf agent
[agent]
# Default data collection interval for all inputs
interval = "5s"
# Rounds collection interval to 'interval'
# ie, if interval="10s" then always collect on :00, :10, :20, etc.
round_interval = false
# 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
# Maximum number of unwritten metrics per output. Increasing this value
# allows for longer periods of output downtime without dropping metrics at the
# cost of higher maximum memory usage.
metric_buffer_limit = 10000
# 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"
# Default flushing interval for all outputs. Maximum flush_interval will be
# flush_interval + flush_jitter
flush_interval = "5s"
# 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"
## Collected metrics are rounded to the precision specified. Precision is
## specified as an interval with an integer + unit (e.g. 0s, 10ms, 2us, 4s).
## Valid time units are "ns", "us" (or "µs"), "ms", "s".
##
## 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:
## ie, when interval = "10s", precision will be "1s"
## when interval = "250ms", precision will be "1ms"
##
## Precision will NOT be used for service inputs. It is up to each individual
## service input to set the timestamp at the appropriate precision.
precision = "0s"
# Run telegraf with debug log messages.
debug = false
# Run telegraf in quiet mode (error log messages only).
quiet = false
# Override default hostname, if empty use os.Hostname().
hostname = ""
# If set to true, do no set the "host" tag in the telegraf agent.
omit_hostname = false
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# INPUT PLUGINS #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Read metrics about system load & uptime.
[[inputs.system]]
# Read metrics about CPU usage.
[[inputs.cpu]]
# Options:
# percpu: Whether to report per-CPU stats or not.
# totalcpu: Whether to report total system CPU stats or not.
# collect_cpu_time: Whether to collect raw CPU time metrics.
percpu = true
totalcpu = true
collect_cpu_time = true
# Read metrics about disk usage by mount point.
[[inputs.disk]]
# By default, telegraf gather stats for all mountpoints.
# Setting mountpoints will restrict the stats to the specified mountpoints.
#mount_points = ["/"]
# Ignore some mountpoints by filesystem type. For example (dev)tmpfs
# (usually present on /run, /var/run, /dev/shm or /dev).
ignore_fs = ["tmpfs", "devtmpfs"]
# Read metrics about disk IO by device.
[[inputs.diskio]]
# By default, telegraf will gather stats for all devices including
# disk partitions.
# Setting devices will restrict the stats to the specified devices.
#devices = ["sda"]
# NOTE: tagpass and tagdrop parameters must be defined at the end of the
# plugin definition, otherwise subsequent plugin config options will be
# interpreted as part of the tagpass/tagdrop map.
# Drop stats for LVM partitions and loop devices.
[inputs.diskio.tagdrop]
name = ["dm*", "loop*"]
# Read metrics about network interface usage.
[[inputs.net]]
# By default, telegraf gathers stats from any up interface (excluding
# loopback). Setting interfaces will tell it to gather these explicit
# interfaces, regardless of status.
interfaces = ["eth*", "vnet0", "virbr0", "docker0"]
# Read metrics about memory usage.
[[inputs.mem]]
# Read metrics about swap memory usage.
[[inputs.swap]]
# Get kernel statistics from /proc/stat.
[[inputs.kernel]]
# Get the number of processes and group them by status.
[[inputs.processes]]
# Read metrics about temperature
[[inputs.temp]]
# Executes the commands on every interval and parses metrics from their output.
[[inputs.exec]]
# Commands array. Glob patterns are matched on every interval, so adding new
# scripts that match the pattern will cause them to be picked up immediately.
commands = ["/opt/mistio/mist-telegraf/custom/*"]
# Timeout for each command to complete.
timeout = "5s"
# Measurement name suffix (for separating different commands),
name_suffix = ""
# Data format to consume. Each data format has its own unique set of
# configuration settings.
data_format = "influx"
# # The libvirt plugin collects statistics from virtualized guests using virtualization libvirt API.
# [[inputs.libvirt]]
# ## Domain names from which libvirt gather statistics.
# ## By default (empty or missing array) the plugin gather statistics from each domain registered in the host system.
# # domains = []
#
# ## Libvirt connection URI with hypervisor.
# ## The plugin supports multiple transport protocols and approaches which are configurable via the URI.
# ## The general URI form: driver[+transport]://[username@][hostname][:port]/[path][?extraparameters]
# ## Supported transport protocols: ssh, tcp, tls, unix
# ## URI examples for each type of transport protocol:
# ## 1. SSH: qemu+ssh://<USER@IP_OR_HOSTNAME>/system?keyfile=/<PATH_TO_PRIVATE_KEY>&known_hosts=/<PATH_TO_known_hosts>
# ## 2. TCP: qemu+tcp://<IP_OR_HOSTNAME>/system
# ## 3. TLS: qemu+tls://<HOSTNAME>/system?pkipath=/certs_dir/<COMMON_LOCATION_OF_CACERT_AND_SERVER_CLIENT_CERTS>
# ## 4. UNIX: qemu+unix:///system?socket=/<PATH_TO_libvirt-sock>
# ## Default URI is qemu:///system
# # libvirt_uri = "qemu:///system"
#
# ## Statistics groups for which libvirt plugin will gather statistics.
# ## Supported statistics groups: state, cpu_total, balloon, vcpu, interface, block, perf, iothread, memory, dirtyrate
# ## Empty array means no metrics for statistics groups will be exposed by the plugin.
# ## By default the plugin will gather all available statistics.
# # statistics_groups = ["state", "cpu_total", "balloon", "vcpu", "interface", "block", "perf", "iothread", "memory", "dirtyrate"]
#
# ## A list containing additional statistics to be exposed by libvirt plugin.
# ## Supported additional statistics: vcpu_mapping
# ## By default (empty or missing array) the plugin will not collect additional statistics.
# # additional_statistics = []
# # Pulls statistics from nvidia GPUs attached to the host
# [[inputs.nvidia_smi]]
# ## Optional: path to nvidia-smi binary, defaults "/usr/bin/nvidia-smi"
# ## We will first try to locate the nvidia-smi binary with the explicitly specified value (or default value),
# ## if it is not found, we will try to locate it on PATH(exec.LookPath), if it is still not found, an error will be returned
# # bin_path = "/usr/bin/nvidia-smi"
#
# ## Optional: timeout for GPU polling
# # timeout = "5s"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# OUTPUT PLUGINS #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
[[outputs.influxdb]]
# The HTTP or UDP URL for your InfluxDB instance.
# Each item should be of the form: scheme "://" host [ ":" port]
#
# Multiple URLs can be specified as part of the same cluster.
# Only ONE of the URLs will be written to each interval.
urls = ["$TELEGRAF_HOST"]
# The target database for metrics (telegraf will create it if not exists).
database = "$TELEGRAF_DB"
# Retention policy to write to. Empty string writes to the default RP.
retention_policy = ""
# Write consistency (clusters only), can be: "any", "one", "quorum", "all".
write_consistency = "any"
# Write timeout (for the InfluxDB client), formatted as a string.
# If not provided, will default to 5s. 0s means no timeout (not recommended).
timeout = "3s"
username = "$TELEGRAF_MACHINE"
password = "$TELEGRAF_PASSWORD"
# Set the user agent for HTTP POSTs (can be useful for log differentiation).
user_agent = "telegraf-$TELEGRAF_MACHINE"
# Optional SSL settings.
#ssl_ca = "/etc/telegraf/ca.pem"
#ssl_key = "/etc/telegraf/key.pem"
#ssl_cert = "/etc/telegraf/cert.pem"
#insecure_skip_verify = false