--- title: 合成监测 type: concept tags: [monitoring, uptime, availability] sources: [] last_updated: 2026-04-15 --- ## 定义 Synthetic Monitoring,通过主动发起探测请求(HTTP/TCP/DNS/TLS)模拟用户行为,检测服务可用性和性能。与 Real User Monitoring(RUM)相对。 ## 核心指标 - **probe_success**:探测是否成功(0/1) - **probe_duration_seconds**:探测响应时间 - **probe_http_status_code**:HTTP 响应码 - **probe_ssl_earliest_cert_expiry**:TLS 证书到期时间戳 ## 工具对比 | 工具 | 类型 | 特点 | |-----|------|-----| | [[blackbox_exporter]] | Prometheus 生态 | 细粒度 PromQL 指标,适合内嵌 Grafana | | [[Uptime Kuma]] | 独立开源 | 友好 UI,适合外网监控 | ## 在 Wiki 中的角色 - [[家庭监控方案 Prometheus + Grafana + Node Exporter + cAdvisor + Blackbox]] 中通过 blackbox_exporter 实现内外网 HTTP/TCP/TLS 探测 - 监控目标:https://pq2435887bh.vicp.fun、http://shenwei-nas.vip.cpolar.cn、https://transmission.vip.cpolar.cn ## 告警规则 ```promql # 站点不可达(连续2分钟) probe_success == 0 for 2m # TLS证书14天内到期 probe_ssl_earliest_cert_expiry - time() < 86400 * 14 ```