We are running Loki since 4 months now. We figured that there was about 4.5TB of S3 storage used till now.
So we wanted to delete the logs.
I enabled retention settings on the compactor and it has been enabled since 10 days. Still I don’t see any reduction in the S3 storage.
Here is my config for Loki
distributor:
ring:
kvstore:
store: memberlist
ingester:
# Disable chunk transfer which is not possible with statefulsets
# and unnecessary for boltdb-shipper
max_transfer_retries: 0
chunk_idle_period: 1h
chunk_target_size: 1536000
max_chunk_age: 1h
wal:
enabled: true
dir: /var/loki/wal
flush_on_shutdown: true
replay_memory_ceiling: 2GB
lifecycler:
join_after: 0s
ring:
kvstore:
store: memberlist
memberlist:
join_members:
- {{ include "loki.fullname" . }}-memberlist
limits_config:
ingestion_rate_mb: 10
ingestion_burst_size_mb: 20
max_concurrent_tail_requests: 20
max_cache_freshness_per_query: 10m
retention_period: 744h
schema_config:
configs:
- from: 2020-09-07
store: boltdb-shipper
object_store: aws
schema: v11
index:
prefix: loki_index_
period: 24h
compactor:
working_directory: /loki/compactor
shared_store: aws
retention_enabled: true
retention_delete_delay: 2h
retention_delete_worker_count: 15000
storage_config:
aws:
s3: s3://ap-southeast-1
bucketnames: loki-prod
boltdb_shipper:
active_index_directory: /var/loki/index
shared_store: s3
cache_location: /var/loki/cache
cache_ttl: 168h
{{- if .Values.indexGateway.enabled }}
index_gateway_client:
server_address: dns:///{{ include "loki.indexGatewayFullname" . }}:9095
{{- end }}
query_range:
align_queries_with_step: true
max_retries: 5
split_queries_by_interval: 15m
cache_results: true
results_cache:
cache:
enable_fifocache: true
fifocache:
max_size_items: 1024
validity: 24h
I also tried the delete api where I set the start date as 0 and end date of a month back. Even after that I don’t see any deletion
- Are the settings correct. Am I missing anything?
- Does Loki actually delete the chunks or should I do it manually?
- Is it ok to delete chunks manually?
I am running loki 2.4 (helm - loki-distributed)