From a22d187d1011b9d2d3582c65d999700dce5af469 Mon Sep 17 00:00:00 2001 From: Max <23087326+MasterPtato@users.noreply.github.com> Date: Thu, 1 Feb 2024 22:18:09 +0000 Subject: [PATCH] Add compactor to loki (#426) Fixes RVT-3598 ## Changes - Adds a compactor to loki to remove old logs --- CHANGELOG.md | 3 ++- infra/tf/k8s_infra/loki.tf | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56178a739..973658313 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Infra** Prometheus VPA - **Infra** Apache Traffic Server VPA - **api-cloud** Admins can view all teams & games in a cluster -- Automatic deploy CI for staging +- Added automatic deploy CI for staging +- **Infra** Added compactor and GC to Loki ### Changed diff --git a/infra/tf/k8s_infra/loki.tf b/infra/tf/k8s_infra/loki.tf index fc432673d..75500a6f5 100644 --- a/infra/tf/k8s_infra/loki.tf +++ b/infra/tf/k8s_infra/loki.tf @@ -41,6 +41,17 @@ resource "helm_release" "loki" { type = "filesystem" } } + compactor = { + retention_enabled = true + retention_delete_delay = "2h" + retention_delete_worker_count = 150 + } + tableManager = { + retention_deletes_enabled = true + # NOTE: This must be a multiple of the index period in `schemaConfig`. Default is 24h + # (https://github.com/grafana/loki/blob/main/cmd/loki/loki-local-config.yaml#L34) + retention_period = "24h" + } singleBinary = { replicas = 1 resources = var.limit_resources ? {