From 93e868360d0d674b356f025be28464868da63f90 Mon Sep 17 00:00:00 2001 From: pangliye Date: Fri, 24 May 2019 10:40:59 +0800 Subject: [PATCH] Add Kafka input to telegraf config Change-Id: I9a8d3dc5f311d4ea4e5d9b03d522632abc66a7ac --- ansible/roles/telegraf/templates/telegraf.conf.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/roles/telegraf/templates/telegraf.conf.j2 b/ansible/roles/telegraf/templates/telegraf.conf.j2 index c603f5ffe2..6d5cad699c 100644 --- a/ansible/roles/telegraf/templates/telegraf.conf.j2 +++ b/ansible/roles/telegraf/templates/telegraf.conf.j2 @@ -84,6 +84,10 @@ [[inputs.zookeeper]] servers = ["{{ api_interface_address }}:{{ zookeeper_port }}"] {% endif %} +{% if inventory_hostname in groups['kafka'] and enable_kafka | bool %} +[[inputs.kafka_consumer]] + brokers = ["{{ api_interface_address }}:{{ 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 }}:{{ database_port }})/"]