global.conf.j2 1.99 KB
Newer Older
1
2
3
4
5
6
7
{{ ansible_managed | comment }}

[global_tags]
  dc = {{ datacenter_name | to_json }}

[agent]
  ## Override default hostname, if empty use os.Hostname()
HgO's avatar
HgO committed
8
9
  hostname = "{{ ansible_fqdn }}"
  user_agent = "telegraf/{{ ansible_fqdn }}"
10
11
12
13
14
15
16
17
18
19


###############################################################################
#                            OUTPUT PLUGINS                                   #
###############################################################################


# Publish all metrics to /metrics for Prometheus to scrape
[[outputs.prometheus_client]]
  ## Address to listen on.
HgO's avatar
HgO committed
20
  listen = "{{ telegraf_prometheus_client_listen_address }}:9273"
21
22
23
24
25
26
27
28
29
30
31

  ## Metric version controls the mapping from Telegraf metrics into
  ## Prometheus format.  When using the prometheus input, use the same value in
  ## both plugins to ensure metrics are round-tripped without modification.
  ##
  ##   example: metric_version = 1; deprecated in 1.13
  ##            metric_version = 2; recommended version
  metric_version = 2

  ## Use HTTP Basic Authentication.
  basic_username = {{ telegraf_username | to_json }}
HgO's avatar
HgO committed
32
  basic_password = {{ telegraf_password | string | to_json }}
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


###############################################################################
#                            INPUT PLUGINS                                    #
###############################################################################


# # Collect statistics about itself
[[inputs.internal]]
  ## If true, collect telegraf memory stats.
  # collect_memstats = true


# Get kernel statistics from /proc/vmstat
[[inputs.kernel_vmstat]]


# Read metrics about network interface usage
[[inputs.net]]


# Read TCP metrics such as established, time wait and sockets counts.
[[inputs.netstat]]


# Gather systemd units state
[[inputs.systemd_units]]
  ## Filter for a specific unit type, default is "service", other possible
  ## values are "socket", "target", "device", "mount", "automount", "swap",
  ## "timer", "path", "slice" and "scope ":
  unittype = "service"