feat: add loki
This commit is contained in:
parent
ddd5ad2c90
commit
044fd84696
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
loki-data
|
||||||
|
loki-wal
|
||||||
24
compose.yml
24
compose.yml
@ -116,6 +116,30 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- teacinema
|
- teacinema
|
||||||
|
|
||||||
|
loki:
|
||||||
|
container_name: loki
|
||||||
|
image: grafana/loki:2.9.1
|
||||||
|
volumes:
|
||||||
|
- ./loki-config.yml:/etc/loki/config.yaml
|
||||||
|
- ./loki-data:/loki
|
||||||
|
- ./loki-wal:/wal
|
||||||
|
command:
|
||||||
|
- -config.file=/etc/loki/config.yaml
|
||||||
|
ports:
|
||||||
|
- "3100:3100"
|
||||||
|
networks:
|
||||||
|
- teacinema
|
||||||
|
|
||||||
|
promatail:
|
||||||
|
container_name: promtail
|
||||||
|
image: grafana/promtail:2.9.1
|
||||||
|
volumes:
|
||||||
|
- ./promtail-config.yml:/etc/promtail/config.yml
|
||||||
|
- ../logs:/var/log/services
|
||||||
|
command: -config.file=/etc/promtail/config.yml
|
||||||
|
networks:
|
||||||
|
- teacinema
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
redis_data:
|
redis_data:
|
||||||
|
|||||||
41
loki-config.yml
Normal file
41
loki-config.yml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
auth_enabled: false
|
||||||
|
|
||||||
|
server:
|
||||||
|
http_listen_port: 3100
|
||||||
|
|
||||||
|
ingester:
|
||||||
|
lifecycler:
|
||||||
|
address: 127.0.0.1
|
||||||
|
ring:
|
||||||
|
kvstore:
|
||||||
|
store: inmemory
|
||||||
|
replication_factor: 1
|
||||||
|
chunk_idle_period: 5m
|
||||||
|
max_chunk_age: 1h
|
||||||
|
|
||||||
|
schema_config:
|
||||||
|
configs:
|
||||||
|
- from: 2020-10-24
|
||||||
|
store: tsdb
|
||||||
|
object_store: filesystem
|
||||||
|
schema: v12
|
||||||
|
index:
|
||||||
|
prefix: index_
|
||||||
|
period: 24h
|
||||||
|
|
||||||
|
storage_config:
|
||||||
|
tsdb_shipper:
|
||||||
|
active_index_directory: /loki/index
|
||||||
|
cache_location: /loki/cache
|
||||||
|
shared_store: filesystem
|
||||||
|
filesystem:
|
||||||
|
directory: /loki/chunks
|
||||||
|
|
||||||
|
limits_config:
|
||||||
|
ingestion_rate_mb: 10
|
||||||
|
ingestion_burst_size_mb: 20
|
||||||
|
max_cache_freshness_per_query: 10m
|
||||||
|
|
||||||
|
compactor:
|
||||||
|
working_directory: /loki/compactor
|
||||||
|
shared_store: filesystem
|
||||||
18
promtail-config.yml
Normal file
18
promtail-config.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
server:
|
||||||
|
http_listen_port: 9080
|
||||||
|
grpc_listen_port: 0
|
||||||
|
|
||||||
|
positions:
|
||||||
|
filename: /tmp/positions.yaml
|
||||||
|
|
||||||
|
clients:
|
||||||
|
- url: http://loki:3100/loki/api/v1/push
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: auth-logs
|
||||||
|
static_configs:
|
||||||
|
- targets: [localhost]
|
||||||
|
labels:
|
||||||
|
job: auth
|
||||||
|
service: auth-service
|
||||||
|
__path__: /var/log/services/auth/*.log
|
||||||
Loading…
x
Reference in New Issue
Block a user