Grafana
-
下载Grafana
-
安装后启动Grafana,url为 http://localhost:3000/
loki
-
下载loki,选择loki-windows-amd64.exe.zip下载
-
解压缩后在同级目录下新建loki-local-config.yaml,内容如下
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: 5m chunk_retain_period: 30s max_transfer_retries: 0 schema_config: configs: - from: 2020-06-22 store: boltdb object_store: filesystem schema: v11 index: prefix: index_ period: 168h storage_config: boltdb: directory: /tmp/loki/index filesystem: directory: /tmp/loki/chunks limits_config: enforce_metric_name: false 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
-
同级目录右键powrshell输入loki启动命令
.\loki-windows-amd64.exe --config.file=loki-local-config.yaml
promtail
-
下载promtail,选择promtail-windows-amd64.exe.zip下载
-
解压缩后在同级目录下新建promtail-local-config.yaml,内容如下
server: http_listen_port: 9080 grpc_listen_port: 0 positions: filename: /tmp/positions.yaml clients: - url: http://localhost:3100/loki/api/v1/push scrape_configs: - job_name: system static_configs: - targets: - localhost labels: job: viplogs __path__: E:\logs\testlogs\*.log - job_name: system static_configs: - targets: - localhost labels: job: viplogs __path__: E:\logs\testlogs\*.log
-
同级目录右键powrshell输入promtail启动命令
.\promtail-windows-amd64.exe --config.file=promtail-local-config.yaml
启动
全部启动后在http://localhost:3000/ 设置中添加数据源