kolla-ansible/ansible/roles/telegraf/templates/telegraf.conf.j2

121 lines
4.9 KiB
Django/Jinja

[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['elasticsearch'] and enable_elasticsearch | bool %}
[[inputs.elasticsearch]]
servers = ["{{ elasticsearch_proto }}://{{ api_interface_address | put_address_in_context('url') }}:{{ elasticsearch_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['outward-rabbitmq'] and enable_outward_rabbitmq | bool %}
[[inputs.rabbitmq]]
url = "{{ outward_rabbitmq_proto }}://{{ api_interface_address | put_address_in_context('url') }}:{{ outward_rabbitmq_management_port }}"
username = "{{ outward_rabbitmq_user }}"
password = "{{ outward_rabbitmq_password }}"
{% endif %}
{% if inventory_hostname in groups['redis'] and enable_redis | bool %}
[[inputs.redis]]
servers = ["tcp://:{{ redis_master_password }}@{{ api_interface_address | put_address_in_context('url') }}:{{ redis_port }}"]
{% endif %}
{% if inventory_hostname in groups['zookeeper'] and enable_zookeeper | bool %}
[[inputs.zookeeper]]
servers = ["{{ api_interface_address | put_address_in_context('url') }}:{{ zookeeper_client_port }}"]
{% endif %}
{% if inventory_hostname in groups['kafka'] and enable_kafka | bool %}
[[inputs.kafka_consumer]]
brokers = ["{{ api_interface_address | put_address_in_context('url') }}:{{ kafka_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 %}