aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/telegraf/templates/telegraf.conf.j2
blob: 67dcfcdacb2d5879644a5945555cfac47e9def3f (plain)
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
[global_tags]
[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  debug = false
  quiet = false
  hostname = ""
  omit_hostname = false
{% if enable_influxdb | bool %}
{%     for host in groups['influxdb'] %}
[[outputs.influxdb]]
  urls = ["{{ influxdb_proto }}://{{ 'api' | kolla_address(host) }}:{{ influxdb_http_port }}"]
  database = "telegraf" # required
  retention_policy = "autogen"
  write_consistency = "any"
  timeout = "5s"
  tls_ca = "{{ openstack_cacert }}"
{%     endfor %}
{% endif %}
[[inputs.cpu]]
  percpu = true
  totalcpu = true
  fielddrop = ["time_*"]
{% if enable_collectd | bool and inventory_hostname in groups['collectd'] %}
[[inputs.socket_listener]]
  service_address = "udp://{{ 'api' | kolla_address | put_address_in_context('url') }}:{{ collectd_udp_port }}"
  name_prefix = "collectd_"
  data_format = "collectd"
  collectd_typesdb = ["/usr/share/collectd/types.db"]
{% endif %}
[[inputs.disk]]
  ignore_fs = ["tmpfs", "devtmpfs"]
[[inputs.diskio]]
{% if inventory_hostname in groups['influxdb'] and enable_influxdb | bool %}
[[inputs.influxdb]]
  urls = ["{{ influxdb_proto }}://{{ 'api' | kolla_address | put_address_in_context('url') }}:{{ influxdb_http_port }}/debug/vars"]
{% endif %}
[[inputs.kernel]]
[[inputs.mem]]
[[inputs.processes]]
[[inputs.swap]]
[[inputs.system]]
[[inputs.net]]
  interfaces = []
{% if inventory_hostname in groups['loadbalancer'] and enable_haproxy | bool %}
[[inputs.haproxy]]
  servers = ["{{ haproxy_proto }}://{{ haproxy_user }}:{{ haproxy_password }}@{{ api_interface_address | put_address_in_context('url') }}:{{ haproxy_stats_port }}"]
{% endif %}
{% if inventory_hostname in groups['memcached'] and enable_memcached | bool %}
[[inputs.memcached]]
  servers = ["{{ api_interface_address | put_address_in_context('url') }}:{{ memcached_port }}"]
{% endif %}
{% if inventory_hostname in groups['opensearch'] and enable_opensearch | bool %}
[[inputs.elasticsearch]]
  servers = ["{{ opensearch_proto }}://{{ api_interface_address | put_address_in_context('url') }}:{{ opensearch_port }}"]
  local = true
  cluster_health = true
{% endif %}
{% if inventory_hostname in groups['rabbitmq'] and enable_rabbitmq | bool %}
[[inputs.rabbitmq]]
  url = "{{ rabbitmq_proto }}://{{ api_interface_address | put_address_in_context('url') }}:{{ rabbitmq_management_port }}"
  username = "{{ rabbitmq_user }}"
  password = "{{ rabbitmq_password }}"
{% endif %}
{% if inventory_hostname in groups['valkey'] and enable_valkey | bool %}
[[inputs.redis]]
  servers = ["tcp://:{{ valkey_master_password }}@{{ api_interface_address | put_address_in_context('url') }}:{{ valkey_server_port }}"]
{% endif %}
{% if inventory_hostname in groups['mariadb'] and (enable_mariadb or enable_external_mariadb_load_balancer) | bool %}
[[inputs.mysql]]
  servers = ["{{ database_user }}:{{ database_password }}@{{ mariadb_proto }}({{ api_interface_address | put_address_in_context('url') }}:{{ database_port }})/"]
  perf_events_statements_digest_text_limit  = 120
  perf_events_statements_limit              = 250
  perf_events_statements_time_limit         = 86400
  table_schema_databases                    = []
  gather_table_schema                       = true
  gather_process_list                       = true
  gather_info_schema_auto_inc               = true
  gather_slave_status                       = true
  gather_binary_logs                        = true
  gather_table_io_waits                     = true
  gather_table_lock_waits                   = true
  gather_index_io_waits                     = true
  gather_event_waits                        = true
  gather_file_events_stats                  = true
  gather_perf_events_statements             = true
  interval_slow                             = "30m"
{% endif %}
{% if telegraf_enable_docker_input | bool %}
[[inputs.docker]]
  endpoint = "unix:///var/run/docker.sock"
  gather_services = false
  container_names = []
  container_name_include = []
  container_name_exclude = []
  timeout = "5s"
  perdevice = true
  total = false
  docker_label_include = []
  docker_label_exclude = []
{% endif %}