diff --git a/roles/loki/README.md b/roles/loki/README.md index 76ecce3..e7baad1 100644 --- a/roles/loki/README.md +++ b/roles/loki/README.md @@ -29,9 +29,10 @@ loki: - selector: '{container_name="nginx-proxy"}' priority: 1 period: 24h + migrate_from_v11: false # migrate from old v11 schema migration_dates: # used to migrate old loki from v11 to v13 v11: "2020-10-24" - v13: "2024-07-08" + v13: "2024-07-06" ``` ### Effects diff --git a/roles/loki/defaults/main.yaml b/roles/loki/defaults/main.yaml index de0430b..923bd75 100644 --- a/roles/loki/defaults/main.yaml +++ b/roles/loki/defaults/main.yaml @@ -13,6 +13,7 @@ loki: - selector: '{container_name="nginx-proxy"}' priority: 1 period: 24h + migrate_from_v11: false migration_dates: v11: "2020-10-24" - v13: "2024-07-08" \ No newline at end of file + v13: "2024-07-06" \ No newline at end of file diff --git a/roles/loki/templates/config.yaml b/roles/loki/templates/config.yaml index 2f11be3..d60b927 100644 --- a/roles/loki/templates/config.yaml +++ b/roles/loki/templates/config.yaml @@ -59,6 +59,7 @@ schema_config: index: prefix: index_ period: 24h +{% if loki.migrate_from_v11 %} - from: '{{ loki.migration_dates.v13 }}' store: tsdb object_store: filesystem @@ -66,6 +67,7 @@ schema_config: index: period: 24h prefix: index_ +{% endif %} #ruler: # alertmanager_url: http://localhost:9093