Last active
May 18, 2023 16:35
-
-
Save rockavoldy/cf012aeee005345b7df820ac3d04db8e to your computer and use it in GitHub Desktop.
loki and promtail config for odoo log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth_enabled: false | |
server: | |
http_listen_port: 3100 | |
grpc_listen_port: 9096 | |
common: | |
instance_addr: 127.0.0.1 | |
path_prefix: /tmp/loki | |
storage: | |
filesystem: | |
chunks_directory: /tmp/loki/chunks | |
rules_directory: /tmp/loki/rules | |
replication_factor: 1 | |
ring: | |
kvstore: | |
store: inmemory | |
query_range: | |
results_cache: | |
cache: | |
embedded_cache: | |
enabled: true | |
max_size_mb: 100 | |
schema_config: | |
configs: | |
- from: 2020-10-24 | |
store: boltdb-shipper | |
object_store: filesystem | |
schema: v11 | |
index: | |
prefix: index_ | |
period: 24h | |
ruler: | |
alertmanager_url: http://localhost:9093 | |
limits_config: | |
ingestion_rate_mb: 10 | |
ingestion_burst_size_mb: 20 | |
max_concurrent_tail_requests: 20 | |
max_cache_freshness_per_query: 10m | |
max_streams_per_user: 50 | |
retention_period: 744h | |
querier: | |
max_concurrent: 1024 | |
compactor: | |
working_directory: /tmp/loki/retention | |
shared_store: filesystem | |
compaction_interval: 10m | |
retention_enabled: true | |
retention_delete_delay: 2h | |
retention_delete_worker_count: 150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: odoo | |
pipeline_stages: | |
- regex: | |
expression: '^(?P<datetime>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}) [^ ]+ (?P<loglevel>[^ ]+) (?P<database>[^ ]+) (?P<model>[^ ]+) (?P<message>.+)$' | |
- multiline: | |
firstline: '^(?P<datetime>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3})' | |
max_wait_time: 3s | |
- labels: | |
level: loglevel | |
model: model | |
- timestamp: | |
source: datetime | |
format: 2006-01-02 15:04:05,999 | |
static_configs: | |
- targets: | |
- localhost | |
labels: | |
job: odoo | |
host: odoo-test | |
__path__: /var/log/odoo/**/*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker container stop loki | |
docker container stop promtail | |
docker run --rm --name loki -d -v $(pwd):/mnt/config -p 3100:3100 grafana/loki -config.file=/mnt/config/loki-config.yaml | |
docker run --rm --name promtail -d -v $(pwd):/mnt/config -v /var/log/odoo:/var/log/odoo --link loki grafana/promtail -config.file=/mnt/config/promtail-config.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment