- 新增 internal/metrics/metrics.go: 14 个 Prometheus 指标 - server.go: /metrics 替换为 promhttp, 15s 后台同步 - go.mod: 新增 client_golang v1.23.2 - deploy/prometheus.yml: 抓取配置 (zhiyid:7821) - deploy/prometheus-alerts.yml: 8 条告警规则 - deploy/prometheus.service: systemd unit
20 lines
370 B
Desktop File
20 lines
370 B
Desktop File
[Unit]
|
|
Description=Prometheus Monitoring
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=muc
|
|
ExecStart=/usr/local/bin/prometheus \
|
|
--config.file=/etc/prometheus/prometheus.yml \
|
|
--storage.tsdb.path=/var/lib/prometheus \
|
|
--web.listen-address=0.0.0.0:9090 \
|
|
--web.enable-lifecycle
|
|
Restart=always
|
|
RestartSec=5
|
|
|
|
MemoryMax=512M
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|