From 765a12dadd9978fcca2e387060b18af688819295 Mon Sep 17 00:00:00 2001 From: Waldek Maleska Date: Wed, 24 Feb 2021 15:35:40 +0000 Subject: [PATCH] add support for Loki ruler configuration update also broken Loki documentation link --- defaults/main.yml | 4 ++-- templates/loki.yml.j2 | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index f74460d..412dca2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -75,7 +75,7 @@ loki_runtime_config: [] loki_table_manager_config: retention_deletes_enabled: false retention_period: 0s - +loki_ruler_config: {} promtail_client_config: - url: "http://{{ loki_listen_address }}:{{ loki_listen_port }}/loki/api/v1/push" @@ -100,4 +100,4 @@ promtail_scrape_config: promtail_target_config: [] promtail_positions_config: - filename: /tmp/positions.yaml \ No newline at end of file + filename: /tmp/positions.yaml diff --git a/templates/loki.yml.j2 b/templates/loki.yml.j2 index 5438373..83ee8ed 100644 --- a/templates/loki.yml.j2 +++ b/templates/loki.yml.j2 @@ -1,6 +1,6 @@ #jinja2: trim_blocks: True, lstrip_blocks: True {{ ansible_managed | comment }} -# https://github.com/grafana/loki/blob/master/docs/configuration/README.md#configuration-file-reference +# https://grafana.com/docs/loki/latest/configuration/ {% if loki_target != "" %} target: {{ loki_target }} @@ -57,3 +57,7 @@ table_manager: runtime_config: {{ loki_runtime_config | to_nice_yaml(indent=2) | indent(2, False) }} {% endif %} +{% if loki_ruler_config %} +ruler: + {{ loki_ruler_config | to_nice_yaml(indent=2) | indent(2, False) }} +{% endif %}