java/monitoring/promtail.yml
liRQ 39a5d5d4ee 任务:添加监控及服务重启脚本
添加Prometheus/Grafana/Loki监控配置、Promtail配置、业务与监控服务器docker-compose文件以及Bash/PowerShell服务重启脚本
2026-06-25 18:27:47 +08:00

30 lines
757 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server:
http_listen_port: 9080 # Promtail HTTP 监听端口
grpc_listen_port: 0 # 禁用 gRPC
positions:
filename: /tmp/positions.yaml # 记录日志读取位置,防止重复采集
clients:
# 指向监控服务器的 Loki通过公网域名发送日志
- url: http://ldfun.asia:3100/loki/api/v1/push
scrape_configs:
# 收集系统日志
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
__path__: /var/log/*.log
# 收集应用日志(各微服务输出到 /opt/wangpan/logs/
- job_name: wangpan-logs
static_configs:
- targets:
- localhost
labels:
job: wangpan
__path__: /opt/wangpan/logs/*.log