Refactor telegraf prometheus input

This commit is contained in:
Tobias Reisinger 2023-12-24 01:26:18 +01:00
parent 05014af744
commit 8a861e080b
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
2 changed files with 15 additions and 5 deletions
roles/telegraf/templates

View file

@ -18,12 +18,19 @@
[[inputs.prometheus]]
urls = [
{%- for url in svc.prometheus.urls -%}
{%- for url in svc.prometheus_unprotected.urls -%}
"{{ url }}",
{%- endfor -%}
]
bearer_token_string = "{{ svc.prometheus.bearer_token }}"
[[inputs.prometheus]]
urls = [
{%- for url in svc.prometheus_protected.urls -%}
"{{ url }}",
{%- endfor -%}
]
bearer_token_string = "{{ svc.prometheus_protected.bearer_token }}"
[[inputs.postgresql]]
address = "postgres://{{ svc.postgresql.user }}:{{ svc.postgresql.pass }}@{{ svc.postgresql.host }}:{{ svc.postgresql.port }}/{{ svc.postgresql.database }}?sslmode=verify-full"