Skip to content

Commit cad2fbe

Browse files
committed
fix(loki): update config for Loki 3.x compatibility
Loki config was written for 2.x and fails on 3.6.7 with: - max_transfer_retries: removed in 3.0 - enforce_metric_name: removed in 3.0 - max_look_back_period: removed in 3.0 Updated to Loki 3.x config: tsdb store, v13 schema, common block, compactor for retention. Volume path changed from /opt/loki to /loki (3.x runs as non-root UID 10001).
1 parent 845b681 commit cad2fbe

4 files changed

Lines changed: 27 additions & 33 deletions

File tree

compose-debug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ services:
3636
command: -config.file=/etc/loki/loki.yml
3737
volumes:
3838
- ./loki/loki.yml:/etc/loki/loki.yml
39-
- ./data/loki:/opt/loki
39+
- ./data/loki:/loki
4040
restart: unless-stopped
4141

4242
charon:

compose-monitoring.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ services:
4343
command: -config.file=/etc/loki/loki.yml
4444
volumes:
4545
- ./loki/loki.yml:/etc/loki/loki.yml
46-
- ./data/loki:/opt/loki
46+
- ./data/loki:/loki
4747
restart: unless-stopped
4848

4949
alloy:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ services:
220220
command: -config.file=/etc/loki/loki.yml
221221
volumes:
222222
- ./loki/loki.yml:/etc/loki/loki.yml
223-
- ./data/loki:/opt/loki
223+
- ./data/loki:/loki
224224
restart: unless-stopped
225225

226226
# _ _ _ _ _ _

loki/loki.yml

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,39 @@ auth_enabled: false
33
server:
44
http_listen_port: 3100
55

6-
ingester:
7-
lifecycler:
8-
address: 127.0.0.1
9-
ring:
10-
kvstore:
11-
store: inmemory
12-
replication_factor: 1
13-
final_sleep: 0s
14-
wal:
15-
enabled: false
16-
chunk_idle_period: 5m
17-
chunk_retain_period: 30s
18-
max_transfer_retries: 0
6+
common:
7+
path_prefix: /loki
8+
storage:
9+
filesystem:
10+
chunks_directory: /loki/chunks
11+
rules_directory: /loki/rules
12+
replication_factor: 1
13+
ring:
14+
kvstore:
15+
store: inmemory
1916

2017
schema_config:
2118
configs:
22-
- from: 2022-01-01
23-
store: boltdb
19+
- from: 2020-10-24
20+
store: tsdb
2421
object_store: filesystem
25-
schema: v11
22+
schema: v13
2623
index:
2724
prefix: index_
28-
period: 168h
29-
30-
storage_config:
31-
boltdb:
32-
directory: /opt/loki/index
33-
34-
filesystem:
35-
directory: /opt/loki/chunks
25+
period: 24h
3626

3727
limits_config:
38-
enforce_metric_name: false
3928
reject_old_samples: true
4029
reject_old_samples_max_age: 168h
30+
allow_structured_metadata: false
4131

42-
chunk_store_config:
43-
max_look_back_period: 0s
32+
ingester:
33+
chunk_idle_period: 1h
34+
max_chunk_age: 1h
35+
chunk_retain_period: 30s
4436

45-
table_manager:
46-
retention_deletes_enabled: false
47-
retention_period: 0s
37+
compactor:
38+
working_directory: /loki/compactor
39+
retention_enabled: true
40+
retention_delete_delay: 2h
41+
delete_request_store: filesystem

0 commit comments

Comments
 (0)