summaryrefslogtreecommitdiff
path: root/data/templates/telegraf/telegraf.j2
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-06-25 09:56:47 +0000
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-06-28 12:48:27 +0000
commit753eef575f06e00cce47352ded7e8ee0b91d10af (patch)
tree629448faa47ac8a3ab1ca8c26221fb8891abfebf /data/templates/telegraf/telegraf.j2
parent679c474e22373d0801459c57fcde8c8c298fe21d (diff)
downloadvyos-1x-753eef575f06e00cce47352ded7e8ee0b91d10af.tar.gz
vyos-1x-753eef575f06e00cce47352ded7e8ee0b91d10af.zip
T6477: Add telegraf loki output plugin
Add Loki plugin to telegraf set service monitoring telegraf loki url xxx (cherry picked from commit 3365eb7ab99fa9a259fe440eb51e82fc0a0a4dc6)
Diffstat (limited to 'data/templates/telegraf/telegraf.j2')
-rw-r--r--data/templates/telegraf/telegraf.j215
1 files changed, 15 insertions, 0 deletions
diff --git a/data/templates/telegraf/telegraf.j2 b/data/templates/telegraf/telegraf.j2
index 9623bdec6..f382dbf2e 100644
--- a/data/templates/telegraf/telegraf.j2
+++ b/data/templates/telegraf/telegraf.j2
@@ -41,6 +41,21 @@
bucket = "{{ influxdb.bucket }}"
### End InfluxDB2 ###
{% endif %}
+{% if loki is vyos_defined %}
+### Loki ###
+[[outputs.loki]]
+ ## The domain of Loki
+ domain = "{{ loki.url }}:{{ loki.port }}"
+{% if loki.authentication.username is vyos_defined and loki.authentication.password is vyos_defined %}
+ ## Basic Authentication
+ username = "{{ loki.authentication.username }}"
+ password = "{{ loki.authentication.password }}"
+{% endif %}
+{% if loki.metric_name_label is vyos_defined %}
+metric_name_label = "{{ loki.metric_name_label }}"
+{% endif %}
+### End Loki ###
+{% endif %}
{% if prometheus_client is vyos_defined %}
### Prometheus ###
[[outputs.prometheus_client]]