Skip to content

Commit

Permalink
feat(loki): move retention config to vars
Browse files Browse the repository at this point in the history
  • Loading branch information
alesharik committed Jul 7, 2024
1 parent f7eb6cb commit 31fb1dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
6 changes: 6 additions & 0 deletions roles/loki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ loki:
tls_hostname: loki.infra.local # server hostname for DNS SAN in TLS cert
clients: # generate TLS creds for:
- grafana
retention:
retention_period: 30d # required, max retention
retention_stream: # configure retention for specific log sets
- selector: '{container_name="nginx-proxy"}'
priority: 1
period: 24h
```
### Effects
Expand Down
8 changes: 7 additions & 1 deletion roles/loki/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ loki:
version: 2.7.4
tls_hostname: loki.infra.local
clients:
- grafana
- grafana
retention:
retention_period: 30d
retention_stream:
- selector: '{container_name="nginx-proxy"}'
priority: 1
period: 24h
10 changes: 3 additions & 7 deletions roles/loki/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,14 @@ compactor:
retention_delete_worker_count: 150

limits_config:
retention_period: 30d
retention_stream:
- selector: '{container_name="nginx-proxy"}'
priority: 1
period: 24h
{{ loki.retention | to_yaml(ident=2) }}

chunk_store_config:
max_look_back_period: 30d
max_look_back_period: {{ loki.retention.retention_period }}

table_manager:
retention_deletes_enabled: true
retention_period: 30d
retention_period: {{ loki.retention.retention_period }}

schema_config:
configs:
Expand Down

0 comments on commit 31fb1dc

Please sign in to comment.