Debian Codegraph @

scripts/grafana/telegraf.conf.template

raw
1 #
2 # Telegraf is entirely plugin driven. All metrics are gathered from the
3 # declared inputs, and sent to the declared outputs.
4 #
5 # Plugins must be declared in here to be active.
6 # To deactivate a plugin, comment out the name and any variables.
7 #
8 # Use 'telegraf -config telegraf.conf -test' to see what metrics a config
9 # file would generate.
10 #
11 # Environment variables can be used anywhere in this config file, simply prepend
12 # them with $. For strings the variable must be within quotes (ie, "$STR_VAR"),
13 # for numbers and booleans they should be plain (ie, $INT_VAR, $BOOL_VAR)
14
15
16 # Global tags can be specified here in key="value" format.
17 [global_tags]
18 # dc = "us-east-1" # will tag all metrics with dc=us-east-1
19 # rack = "1a"
20 ## Environment variables can be used as tags, and throughout the config file
21 # user = "$USER"
22
23
24 # Configuration for telegraf agent
25 [agent]
26 ## Default data collection interval for all inputs
27 # interval = "2s"
28 ## Rounds collection interval to 'interval'
29 ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
30 round_interval = false
31
32 ## Telegraf will send metrics to outputs in batches of at
33 ## most metric_batch_size metrics.
34 metric_batch_size = 1000
35 ## For failed writes, telegraf will cache metric_buffer_limit metrics for each
36 ## output, and will flush this buffer on a successful write. Oldest metrics
37 ## are dropped first when this buffer fills.
38 metric_buffer_limit = 10000
39
40 ## Collection jitter is used to jitter the collection by a random amount.
41 ## Each plugin will sleep for a random time within jitter before collecting.
42 ## This can be used to avoid many plugins querying things like sysfs at the
43 ## same time, which can have a measurable effect on the system.
44 collection_jitter = "0s"
45
46 ## Default flushing interval for all outputs. You shouldn't set this below
47 ## interval. Maximum flush_interval will be flush_interval + flush_jitter
48 flush_interval = "1s"
49 ## Jitter the flush interval by a random amount. This is primarily to avoid
50 ## large write spikes for users running a large number of telegraf instances.
51 ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
52 flush_jitter = "0s"
53
54 ## By default, precision will be set to the same timestamp order as the
55 ## collection interval, with the maximum being 1s.
56 ## Precision will NOT be used for service inputs, such as logparser and statsd.
57 ## Valid values are "ns", "us" (or "µs"), "ms", "s".
58 precision = ""
59 ## Run telegraf in debug mode
60 debug = false
61 ## Run telegraf in quiet mode
62 quiet = false
63 ## Override default hostname, if empty use os.Hostname()
64 ## hostname = ""
65 ## If set to true, do no set the "host" tag in the telegraf agent.
66 omit_hostname = false
67
68
69 ###############################################################################
70 # OUTPUT PLUGINS #
71 ###############################################################################
72
73 # Configuration for influxdb server to send metrics to
74 [[outputs.influxdb]]
75 ## The full HTTP or UDP endpoint URL for your InfluxDB instance.
76 ## Multiple urls can be specified as part of the same cluster,
77 ## this means that only ONE of the urls will be written to each interval.
78 # urls = ["udp://localhost:8089"] # UDP endpoint example
79 urls = ["http://influxdb:8086"] # required
80 ## The target database for metrics (telegraf will create it if not exists).
81 database = "telegraf" # required
82
83 ## Retention policy to write to. Empty string writes to the default rp.
84 retention_policy = ""
85 ## Write consistency (clusters only), can be: "any", "one", "quorum", "all"
86 write_consistency = "any"
87
88 ## Write timeout (for the InfluxDB client), formatted as a string.
89 ## If not provided, will default to 5s. 0s means no timeout (not recommended).
90 timeout = "5s"
91 # username = "telegraf"
92 # password = "metricsmetricsmetricsmetrics"
93 ## Set the user agent for HTTP POSTs (can be useful for log differentiation)
94 # user_agent = "telegraf"
95 ## Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes)
96 # udp_payload = 512
97
98 ## Optional SSL Config
99 # ssl_ca = "/etc/telegraf/ca.pem"
100 # ssl_cert = "/etc/telegraf/cert.pem"
101 # ssl_key = "/etc/telegraf/key.pem"
102 ## Use SSL but skip chain & host verification
103 # insecure_skip_verify = false
104
105 [[inputs.http]]
106 urls = [
107 "PCMSENSORSERVER/persecond/"
108 ]
109 interval = "2s"
110 data_format = "json"
111 headers = {"Accept" = "application/json"}
112
113