Files
ewoooc/docker/promtail/promtail-config.yaml
ogt 1b4f3a7bbe
Some checks failed
CD Pipeline / deploy (push) Failing after 59s
feat: EwoooC 初始化 — 完整專案推版至 Gitea
- 建立 Gitea Actions CD pipeline (.gitea/workflows/cd.yaml)
- 部署模式: rsync Python 檔案至 188 → docker restart (volume mount)
- Dockerfile/requirements 變動時自動重建 Docker image
- 部署通知: Telegram (開始/成功/失敗)
- 健康檢查: https://mo.wooo.work/health (最多 5 次重試)
- 同步最新 CLAUDE.md / ADR-008 / memory (2026-04-19)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 01:21:13 +08:00

120 lines
3.6 KiB
YAML

# =============================================================================
# WOOO TECH - Momo Pro System
# Promtail Configuration
# =============================================================================
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:
# ==========================================================================
# Flask/Gunicorn Application Logs
# ==========================================================================
- job_name: momo-app
static_configs:
- targets:
- localhost
labels:
job: momo-app
env: production
__path__: /var/log/app/*.log
pipeline_stages:
- multiline:
firstline: '^\d{4}-\d{2}-\d{2}'
max_wait_time: 3s
- regex:
expression: '^(?P<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}) - (?P<level>\w+) - (?P<message>.*)$'
- labels:
level:
- timestamp:
source: timestamp
format: '2006-01-02 15:04:05,000'
# ==========================================================================
# Gunicorn Access Log
# ==========================================================================
- job_name: gunicorn-access
static_configs:
- targets:
- localhost
labels:
job: gunicorn-access
env: production
__path__: /var/log/app/gunicorn-access.log
pipeline_stages:
- regex:
expression: '^(?P<remote_addr>\S+) - - \[(?P<time_local>[^\]]+)\] "(?P<method>\S+) (?P<path>\S+) (?P<protocol>\S+)" (?P<status>\d+) (?P<body_bytes>\d+) "(?P<referer>[^"]*)" "(?P<user_agent>[^"]*)"'
- labels:
method:
status:
path:
# ==========================================================================
# Gunicorn Error Log
# ==========================================================================
- job_name: gunicorn-error
static_configs:
- targets:
- localhost
labels:
job: gunicorn-error
env: production
__path__: /var/log/app/gunicorn-error.log
pipeline_stages:
- multiline:
firstline: '^\[\d{4}-\d{2}-\d{2}'
max_wait_time: 3s
# ==========================================================================
# Nginx Access Log
# ==========================================================================
- job_name: nginx-access
static_configs:
- targets:
- localhost
labels:
job: nginx-access
env: production
__path__: /var/log/nginx/*access*.log
pipeline_stages:
- regex:
expression: '^(?P<remote_addr>\S+) - (?P<remote_user>\S+) \[(?P<time_local>[^\]]+)\] "(?P<method>\S+) (?P<path>\S+) (?P<protocol>\S+)" (?P<status>\d+) (?P<body_bytes>\d+) "(?P<referer>[^"]*)" "(?P<user_agent>[^"]*)"'
- labels:
method:
status:
- metrics:
http_request_total:
type: Counter
description: "Total HTTP requests"
source: status
config:
action: inc
# ==========================================================================
# Nginx Error Log
# ==========================================================================
- job_name: nginx-error
static_configs:
- targets:
- localhost
labels:
job: nginx-error
env: production
__path__: /var/log/nginx/*error*.log
pipeline_stages:
- multiline:
firstline: '^\d{4}/\d{2}/\d{2}'
max_wait_time: 3s