From 589677c50a2cf198be746af9e7f74f91d58514ca Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Tue, 29 Oct 2024 14:52:26 +0100 Subject: [PATCH] Update telegraf config --- playbooks/roles/telegraf/templates/telegraf.conf.j2 | 9 ++++++++- playbooks/roles/telegraf/vars/main.yml | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/telegraf/templates/telegraf.conf.j2 b/playbooks/roles/telegraf/templates/telegraf.conf.j2 index 654b933..04b44c1 100644 --- a/playbooks/roles/telegraf/templates/telegraf.conf.j2 +++ b/playbooks/roles/telegraf/templates/telegraf.conf.j2 @@ -7,7 +7,7 @@ flush_interval = "10s" flush_jitter = "0s" precision = "" - hostname = "node002.serguzim.me" + hostname = "{{ inventory_hostname }}" omit_hostname = false [[outputs.influxdb_v2]] @@ -16,6 +16,13 @@ organization = "{{ svc.influxdb.organization }}" bucket = "{{ svc.influxdb.bucket }}" +[[inputs.prometheus]] + urls = [ + {%- for host_data in opentofu.hosts.values() -%} + "https://{{ host_data.fqdn_vpn }}:2019/metrics", + {%- endfor -%} + ] + [[inputs.prometheus]] urls = [ {%- for url in svc.prometheus_unprotected.urls -%} diff --git a/playbooks/roles/telegraf/vars/main.yml b/playbooks/roles/telegraf/vars/main.yml index 5210f29..3a864b8 100644 --- a/playbooks/roles/telegraf/vars/main.yml +++ b/playbooks/roles/telegraf/vars/main.yml @@ -7,7 +7,6 @@ telegraf_svc: bucket: metrics prometheus_unprotected: urls: - - http://node002.vpn.serguzim.net:2019/metrics - https://matrix.serguzim.me/_synapse/metrics - https://push.serguzim.me/metrics - https://tick.serguzim.me/metrics