-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
129 lines (119 loc) · 3.79 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
129 lines (119 loc) · 3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: distr-dev
services:
postgres:
image: 'postgres:18.6-alpine3.23'
environment:
POSTGRES_USER: local
POSTGRES_PASSWORD: local
POSTGRES_DB: distr
volumes:
- 'postgres:/var/lib/postgresql/'
ports:
- '5432:5432'
mailpit:
image: 'axllent/mailpit:v1.31.1'
ports:
- '1025:1025'
- '8025:8025'
storage:
image: 'rustfs/rustfs:1.0.0'
ports:
- '127.0.0.1:9000:9000'
- '127.0.0.1:9001:9001'
volumes:
- 'rustfs:/data/'
environment:
RUSTFS_ACCESS_KEY: local
RUSTFS_SECRET_KEY: local
healthcheck:
test: ['CMD', 'sh', '-c', 'curl -f http://127.0.0.1:9000/health']
start_interval: 1s
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Loki stores deployment and deployment target log records. It runs in monolithic
# (single-binary) mode and persists chunks + TSDB index in the rustfs "loki" bucket.
# The bucket is created by a pre_start init container (requires Docker Compose >= 5.3.0).
loki:
image: 'grafana/loki:3.7.7'
command: ['-config.file=/etc/loki/distr-config.yaml']
configs:
- source: loki-config
target: /etc/loki/distr-config.yaml
ports:
- '127.0.0.1:3100:3100'
volumes:
- 'loki:/loki'
depends_on:
storage:
condition: service_healthy
pre_start:
- image: 'rclone/rclone:1.74.4'
environment:
RCLONE_CONFIG_STORAGE_TYPE: s3
RCLONE_CONFIG_STORAGE_PROVIDER: Other
RCLONE_CONFIG_STORAGE_ENDPOINT: 'http://storage:9000'
RCLONE_CONFIG_STORAGE_ACCESS_KEY_ID: local
RCLONE_CONFIG_STORAGE_SECRET_ACCESS_KEY: local
command: ['mkdir', 'storage:loki']
configs:
loki-config:
content: |
auth_enabled: true
server:
http_listen_port: 3100
# A single query result page (max_entries_limit_per_query entries) can exceed
# the 4 MB gRPC default, which makes the internal querier->frontend handoff
# fail and the query hang until it times out.
grpc_server_max_recv_msg_size: 67108864
grpc_server_max_send_msg_size: 67108864
common:
path_prefix: /loki
replication_factor: 1
ring:
kvstore:
store: inmemory
schema_config:
configs:
- from: "2024-01-01"
store: tsdb
object_store: s3
schema: v13
index:
prefix: index_
period: 24h
storage_config:
aws:
endpoint: http://storage:9000
region: local
access_key_id: local
secret_access_key: local
bucketnames: loki
s3forcepathstyle: true
compactor:
retention_enabled: true
delete_request_store: s3
working_directory: /loki/compactor
limits_config:
# 30 days (business log query window) plus the 24h timezone slack and 1h margin.
retention_period: 745h
# Business queries may span the full window incl. the timezone slack, which
# exceeds Loki's default max_query_length of 30d1h.
max_query_length: 745h
increment_duplicate_timestamp: true
allow_structured_metadata: true
max_global_streams_per_user: 25000
# Truncate oversized log lines instead of rejecting the whole push.
max_line_size_truncate: true
# Accept backfilled logs up to the retention period so an agent that was
# offline can still push its backlog.
reject_old_samples_max_age: 745h
# Raised from the 4/6 MB defaults so the log generator dev tool
# (cmd/distr/generate/logs) can bulk-ingest without excessive throttling.
ingestion_rate_mb: 64
ingestion_burst_size_mb: 128
volumes:
postgres:
rustfs:
loki: