add retention period; update loki

This commit is contained in:
Philipp Rothmann 2023-05-21 12:50:32 +02:00
parent ceb851060a
commit 30f2a52622
3 changed files with 12 additions and 2 deletions

View File

@ -29,6 +29,9 @@ DOMAIN=monitoring.example.com
# Loki Server
#
# COMPOSE_FILE="$COMPOSE_FILE:compose.loki.yml"
#
# Set to 0 to disable retention
# LOKI_RETENTION_PERIOD=744h
# LOKI_STORAGE_FILESYSTEM=1
#
## S3 Storage

View File

@ -2,7 +2,7 @@ version: '3.8'
services:
loki:
image: grafana/loki:2.0.0
image: grafana/loki:2.8.2
# entrypoint: 'tail -f /dev/null'
command: -config.file=/etc/loki/local-config.yaml
networks:
@ -19,6 +19,7 @@ services:
- LOKI_AWS_ENDPOINT
- LOKI_AWS_REGION
- LOKI_BUCKET_NAMES
- LOKI_RETENTION_PERIOD
- STACK_NAME
- LOKI_STORAGE_FILESYSTEM
- LOKI_STORAGE_S3

View File

@ -34,7 +34,8 @@ ingester:
chunk_target_size: 1048576 # Loki will attempt to build chunks up to 1.5MB, flushing first if chunk_idle_period or max_chunk_age is reached first
chunk_retain_period: 30s # Must be greater than index read cache TTL if using an index cache (Default index read cache TTL is 5m)
max_transfer_retries: 0 # Chunk transfers disabled
wal:
dir: "/tmp/wal"
memberlist:
abort_if_cluster_join_fails: false
@ -102,11 +103,16 @@ storage_config:
compactor:
working_directory: /loki/boltdb-shipper-compactor
shared_store: filesystem
compaction_interval: 10m
retention_enabled: true
retention_delete_delay: 2h
retention_delete_worker_count: 150
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
retention_period: {{ env "LOKI_RETENTION_PERIOD" }}
chunk_store_config:
max_look_back_period: 0s