11# This is based on the config file from the loki helm chart.
2- # It was changed to set up retention for 90 days, see: https://grafana.com/docs/loki/latest/operations/storage/retention/
2+ # Modifications are commented below
33
44auth_enabled : false
5- chunk_store_config :
6- max_look_back_period : 0s
7- compactor :
8- shared_store : filesystem
9- working_directory : /data/loki/boltdb-shipper-compactor
10- compaction_interval : 10m # MODIFIED
11- retention_enabled : true # MODIFIED
12- retention_delete_delay : 2h # MODIFIED
13- retention_delete_worker_count : 150 # MODIFIED
14- ingester :
15- chunk_block_size : 262144
16- chunk_idle_period : 3m
17- chunk_retain_period : 1m
18- lifecycler :
19- ring :
20- replication_factor : 1
21- max_transfer_retries : 0
22- wal :
23- dir : /data/loki/wal
5+ common :
6+ compactor_address : ' http://loki:3100'
7+ path_prefix : /var/loki
8+ replication_factor : 1
9+ storage :
10+ filesystem :
11+ chunks_directory : /var/loki/loki/chunks
12+ rules_directory : /var/loki/rules
13+ frontend :
14+ scheduler_address : " "
15+ frontend_worker :
16+ scheduler_address : " "
17+ index_gateway :
18+ mode : ring
2419limits_config :
25- enforce_metric_name : false
26- max_entries_limit_per_query : 5000
20+ max_cache_freshness_per_query : 10m
2721 reject_old_samples : true
2822 reject_old_samples_max_age : 168h
29- retention_period : 90d # MODIFIED
30- # split_queries_by_interval: 15m # https://github.com/grafana/loki/issues/5123#issuecomment-1167018445
31- # max_query_parallelism: 32 # https://github.com/grafana/loki/issues/5123#issuecomment-1167018445
32- split_queries_by_interval : 0
33- query_range :
34- parallelise_shardable_queries : false
35- # query_scheduler:
36- # max_outstanding_requests_per_tenant: 4096 # https://github.com/grafana/loki/issues/5123#issuecomment-1167018445
37- # frontend:
38- # max_outstanding_per_tenant: 4096 # https://github.com/grafana/loki/issues/5123#issuecomment-1167018445
23+ split_queries_by_interval : 15m
24+ # Modified to have retention of 90 days
25+ retention_period : 90d
3926memberlist :
4027 join_members :
41- - ' dummy-release-loki-memberlist'
28+ - loki-memberlist
29+ query_range :
30+ align_queries_with_step : true
31+ ruler :
32+ storage :
33+ type : local
34+ runtime_config :
35+ file : /etc/loki/runtime-config/runtime-config.yaml
4236schema_config :
4337 configs :
4438 - from : " 2020-10-24"
@@ -48,17 +42,30 @@ schema_config:
4842 object_store : filesystem
4943 schema : v11
5044 store : boltdb-shipper
45+
46+ # ###############################################################################
47+ # IMPORTANT: update this date to be one day after you update Loki! #
48+ # This ensures old logs are still accessible, while new logs use the new schema #
49+ # ###############################################################################
50+ - from : " 2024-03-19"
51+ index :
52+ period : 24h
53+ prefix : loki_index_
54+ object_store : filesystem
55+ schema : v12
56+ store : boltdb-shipper
5157server :
5258 grpc_listen_port : 9095
5359 http_listen_port : 3100
5460storage_config :
55- boltdb_shipper :
56- active_index_directory : /data/loki/boltdb-shipper-active
57- cache_location : /data/loki/boltdb-shipper-cache
58- cache_ttl : 24h
59- shared_store : filesystem
60- filesystem :
61- directory : /data/loki/chunks
62- table_manager :
63- retention_deletes_enabled : false
64- retention_period : 0s
61+ hedging :
62+ at : 250ms
63+ max_per_second : 20
64+ up_to : 3
65+ tracing :
66+ enabled : false
67+
68+ # modified to make retention work
69+ # https://grafana.com/docs/loki/latest/setup/upgrade/#240
70+ compactor :
71+ retention_enabled : true
0 commit comments