From 5c37fdd99e458abb3f66ee2ef81da6db7d618a31 Mon Sep 17 00:00:00 2001 From: Alpha Yu Date: Fri, 13 Oct 2023 18:32:18 +0800 Subject: [PATCH] docs: add loki.yml files --- doc/loki/docker-compose.yml | 0 doc/loki/loki.yml | 64 ++++++++++++++++++++++++++++++ doc/loki/promtail.yml | 18 +++++++++ src/ServerApi/version_shared.props | 2 +- 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 doc/loki/docker-compose.yml create mode 100644 doc/loki/loki.yml create mode 100644 doc/loki/promtail.yml diff --git a/doc/loki/docker-compose.yml b/doc/loki/docker-compose.yml new file mode 100644 index 000000000..e69de29bb diff --git a/doc/loki/loki.yml b/doc/loki/loki.yml new file mode 100644 index 000000000..770dcfb94 --- /dev/null +++ b/doc/loki/loki.yml @@ -0,0 +1,64 @@ +auth_enabled: false + +server: + http_listen_port: 3100 + +ingester: + lifecycler: + address: 127.0.0.1 + ring: + kvstore: + store: inmemory + replication_factor: 1 + final_sleep: 0s + chunk_idle_period: 1h # 此时没有接收到新日志的任何块都将被刷新 + max_chunk_age: 1h # 所有的块将刷新时,他们达到这个年龄,默认是1h + chunk_target_size: 1048576 # Loki将尝试构建最大为1.5MB的块,如果先达到chunk_idle_period或max_chunk_age,则首先刷新 + chunk_retain_period: 30s # 如果使用索引缓存,必须大于索引读缓存TTL(默认索引读缓存TTL为5m) + max_transfer_retries: 0 # 块传输禁用 + +schema_config: + configs: + - from: 2023-5-8 + store: boltdb-shipper + object_store: filesystem + schema: v11 + index: + prefix: index_ + period: 24h + +storage_config: + boltdb_shipper: + active_index_directory: /loki/boltdb-shipper-active + cache_location: /loki/boltdb-shipper-cache + cache_ttl: 24h # 可以在更长的查询周期内提高更快的性能,使用更多的磁盘空间 + shared_store: filesystem + filesystem: + directory: /loki/chunks + +compactor: + working_directory: /loki/boltdb-shipper-compactor + shared_store: filesystem + +limits_config: + reject_old_samples: true + reject_old_samples_max_age: 168h + +chunk_store_config: + max_look_back_period: 0s + +table_manager: + retention_deletes_enabled: false + retention_period: 0s + +ruler: + storage: + type: local + local: + directory: /loki/rules + rule_path: /loki/rules-temp + alertmanager_url: http://localhost:9093 + ring: + kvstore: + store: inmemory + enable_api: true diff --git a/doc/loki/promtail.yml b/doc/loki/promtail.yml new file mode 100644 index 000000000..bd05f2222 --- /dev/null +++ b/doc/loki/promtail.yml @@ -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: system + static_configs: + - targets: + - localhost + labels: + job: varlogs + __path__: /var/log/*log diff --git a/src/ServerApi/version_shared.props b/src/ServerApi/version_shared.props index b54681ef2..383cc862a 100644 --- a/src/ServerApi/version_shared.props +++ b/src/ServerApi/version_shared.props @@ -3,7 +3,7 @@ 0 9 9 - 6 + 7 $(VersionMajor).$(VersionMinor).$(VersionPatch).$(VersionQuality)