From 78c66cd992032420ca3af35f91f98c27fe5041b0 Mon Sep 17 00:00:00 2001 From: Nenad Radojevic Date: Tue, 27 Dec 2016 23:22:20 +0000 Subject: [PATCH] Missing mysql plugin in telegraf Added mysql plugin for telegraf to be used by default. Plugin gathers the statistic data from MySQL server. Change-Id: I853af61b64739eedb70ab2b8dc78f0285a839671 Closes-Bug: #1652609 --- ansible/roles/telegraf/defaults/main.yml | 1 + .../roles/telegraf/templates/telegraf.conf.j2 | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ansible/roles/telegraf/defaults/main.yml b/ansible/roles/telegraf/defaults/main.yml index c11bf0a379..48ff1c557d 100644 --- a/ansible/roles/telegraf/defaults/main.yml +++ b/ansible/roles/telegraf/defaults/main.yml @@ -16,3 +16,4 @@ elasticsearch_proto: "http" haproxy_proto: "http" influxdb_proto: "http" rabbitmq_proto: "http" +mariadb_proto: "tcp" diff --git a/ansible/roles/telegraf/templates/telegraf.conf.j2 b/ansible/roles/telegraf/templates/telegraf.conf.j2 index 1f81ad91cb..6b40f41c53 100644 --- a/ansible/roles/telegraf/templates/telegraf.conf.j2 +++ b/ansible/roles/telegraf/templates/telegraf.conf.j2 @@ -51,3 +51,23 @@ username = "{{ rabbitmq_user }}" password = "{{ rabbitmq_password }}" {% endif %} +{% if inventory_hostname in groups['mariadb'] and enable_mariadb | bool %} +[[inputs.mysql]] + servers = ["{{ database_user }}:{{ database_password }}@{{ mariadb_proto }}({{ api_interface_address }}:{{ 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 %}