Hello there!
I’ve configured whole PGL stack but didn’t think about one, very important thing which is - log expiration time.
I’m not able to view logs older that 24h i guess? I’d like them to be visible for at least 14 days, perferably 30 days.
Also, they should be stored in the filesystem, i don’t have any network storage for now.
Below is the configuration I use now (after some tweaks - I changed the times), will it work? I have to be 100% sure that the logs won’t disappear after 1 days and I’ll be able to view them.
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9096
http_server_read_timeout: 20m
http_server_write_timeout: 20m
ingester:
wal:
enabled: true
dir: /tmp/wal
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 1h # Any chunk not receiving new logs in this time will be flushed
max_chunk_age: 1h # All chunks will be flushed when they hit this age, default is 1h
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
schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb_shipper:
active_index_directory: /tmp/loki/boltdb-shipper-active
cache_location: /tmp/loki/boltdb-shipper-cache
resync_interval: 60s
shared_store: filesystem
query_ready_num_days: 14
cache_ttl: 336h
filesystem:
directory: /tmp/loki/chunks
querier:
query_timeout: 20m
engine:
timeout: 20m
compactor:
working_directory: /tmp/loki/boltdb-shipper-compactor
shared_store: filesystem
retention_enabled: true
compaction_interval: 10m
retention_delete_delay: 336h
limits_config:
reject_old_samples: false
ingestion_rate_mb: 16
ingestion_burst_size_mb: 32
max_streams_per_user: 100000
reject_old_samples_max_age: 744h
retention_period: 744h
chunk_store_config:
max_look_back_period: 744h
table_manager:
retention_deletes_enabled: true
retention_period: 744h
ruler:
storage:
type: local
local:
directory: /tmp/loki/rules
rule_path: /tmp/loki/rules-temp
alertmanager_url: http://localhost:9093
ring:
kvstore:
store: inmemory
enable_api: true
search_pending_for: 20m
I’m kindly requesting your help, because I don’t know how to configure this on my own.
Thanks in advance!