Open Dolbodrynya opened 1 year ago
We have the same problem. There is no way to delete the logs older than 120 days that we have configured. Loki seems to ignore this error.
Loki Version:
loki, version 2.6.1 (branch: HEAD, revision: 6bd05c9a4)
build user: root@af90ed01061f
build date: 2022-07-18T08:41:09Z
go version: go1.17.6
platform: linux/amd64
Loki Config:
auth_enabled: false
server:
http_listen_port: 3100
grpc_server_max_recv_msg_size: 41943040
register_instrumentation: false
grpc_server_max_send_msg_size: 41943040
ingester:
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 5m
chunk_retain_period: 30s
wal:
dir: /data/loki/walschema_config:
configs:
- from: 2018-04-15
store: boltdb
object_store: filesystem
schema: v11
index:
prefix: index_
period: 168h
- from: 2022-09-16
store: boltdb
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb:
directory: /data/loki/index filesystem:
directory: /data/loki/chunkslimits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
retention_period: 2880hchunk_store_config:
max_look_back_period: 0table_manager:
chunk_tables_provisioning:
inactive_read_throughput: 0
inactive_write_throughput: 0
provisioned_read_throughput: 0
provisioned_write_throughput: 0
index_tables_provisioning:
inactive_read_throughput: 0
inactive_write_throughput: 0
provisioned_read_throughput: 0
provisioned_write_throughput: 0
retention_deletes_enabled: true
retention_period: 2880h
analytics:
reporting_enabled: falseruler:
storage:
type: local
local:
directory: /data/loki/rules
rule_path: /data/loki/rules-temp
ring:
kvstore:
store: inmemory
enable_api: true
wal:
dir: /data/loki/ruler-walcompactor:
working_directory: /data/loki/retention
shared_store: filesystem
compaction_interval: 10m
retention_enabled: true
retention_delete_delay: 2h
retention_delete_worker_count: 150
We solve the problem with an update to the version 2.9 of loki and this config:
auth_enabled: false
server:
http_listen_port: 3100
grpc_server_max_recv_msg_size: 41943040
register_instrumentation: false
grpc_server_max_send_msg_size: 41943040
common:
instance_addr: 127.0.0.1
path_prefix: /data/loki
storage:
filesystem:
chunks_directory: /data/loki/chunks
rules_directory: /data/loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory
ingester:
chunk_idle_period: 5m
chunk_retain_period: 30s
wal:
dir: /data/loki/wal
query_scheduler:
max_outstanding_requests_per_tenant: 32768
querier:
max_concurrent: 16
query_range:
results_cache:
cache:
embedded_cache:
enabled: true
max_size_mb: 512
schema_config:
configs:
- from: 2018-04-15
store: boltdb
object_store: filesystem
schema: v11
index:
prefix: index_
period: 168h
- from: 2022-09-16
store: boltdb
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
- from: 2023-09-13
store: tsdb
object_store: filesystem
schema: v12
index:
prefix: tsdb_index_
period: 24h
storage_config:
boltdb:
directory: /data/loki/index
tsdb_shipper:
active_index_directory: /data/loki/tsdb-index
cache_location: /data/loki/tsdb-cache
shared_store: filesystem
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
retention_period: 2880h
chunk_store_config:
max_look_back_period: 2880h
table_manager:
retention_deletes_enabled: true
retention_period: 2880h
analytics:
reporting_enabled: false
ruler:
enable_api: true
wal:
dir: /data/loki/ruler-wal
compactor:
working_directory: /data/loki/retention
shared_store: filesystem
compaction_interval: 10m
retention_enabled: true
delete_request_cancel_period: 5m
retention_table_timeout: 1h
retention_delete_delay: 5m
retention_delete_worker_count: 150
Ticket can be closed!
Describe the bug Old data is not being deleted.
To Reproduce
Expected behavior The expectation is that data with the label selector '{unit="NetworkManager.service"}' will be deleted after 24 hours, but this is not happening.
Environment:
Screenshots, Promtail config, or terminal output