<svg xmlns="http://www.w3.org/2000/svg" width="960" height="540" viewBox="0 0 960 540" role="img" aria-labelledby="title desc">
  <title id="title">指标采集到告警通知的数据流</title>
  <desc id="desc">展示应用和Exporter暴露指标后，经服务发现、Prometheus采集、TSDB存储、PromQL规则计算和Alertmanager通知的流程。</desc>
  <rect width="960" height="540" fill="#f7fafc"/>
  <defs>
    <marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto" markerUnits="strokeWidth"><path d="M0,0 L0,6 L9,3 z" fill="#2563eb"/></marker>
    <style>text{font-family:Arial,'Microsoft YaHei',sans-serif;fill:#1f2937}.h{font-size:20px;font-weight:700}.t{font-size:15px;font-weight:700}.s{font-size:13px;fill:#4b5563}.box{fill:#fff;stroke:#cbd5e1;stroke-width:1.5}.blue{fill:#e0f2fe;stroke:#38bdf8}.green{fill:#dcfce7;stroke:#22c55e}.orange{fill:#ffedd5;stroke:#fb923c}.purple{fill:#ede9fe;stroke:#8b5cf6}.line{stroke:#2563eb;stroke-width:2.5;fill:none;marker-end:url(#arrow)}</style>
  </defs>
  <text x="48" y="46" class="h">从指标暴露到告警通知</text>
  <text x="48" y="72" class="s">核心链路按数据流理解：发现目标 → 周期采集 → 写入时序 → 查询规则 → 通知路由</text>

  <rect x="42" y="122" width="180" height="120" rx="16" class="blue"/>
  <text x="72" y="154" class="t">指标来源</text>
  <text x="66" y="184" class="s">应用 / Exporter</text>
  <text x="66" y="208" class="s">/metrics 端点</text>

  <rect x="282" y="122" width="170" height="120" rx="16" class="green"/>
  <text x="320" y="154" class="t">服务发现</text>
  <text x="306" y="184" class="s">静态配置</text>
  <text x="306" y="208" class="s">Kubernetes SD</text>

  <rect x="512" y="122" width="170" height="120" rx="16" class="orange"/>
  <text x="548" y="154" class="t">采集写入</text>
  <text x="536" y="184" class="s">Scrape 周期</text>
  <text x="536" y="208" class="s">本地 TSDB</text>

  <rect x="742" y="122" width="170" height="120" rx="16" class="purple"/>
  <text x="780" y="154" class="t">查询计算</text>
  <text x="766" y="184" class="s">PromQL</text>
  <text x="766" y="208" class="s">规则评估</text>

  <path d="M222 182 H282" class="line"/>
  <path d="M452 182 H512" class="line"/>
  <path d="M682 182 H742" class="line"/>

  <rect x="168" y="330" width="190" height="100" rx="16" class="box"/>
  <text x="218" y="362" class="t">仪表盘</text>
  <text x="198" y="392" class="s">趋势 / 面板 / 排查</text>
  <path d="M592 242 C560 290 445 322 358 360" class="line"/>

  <rect x="466" y="330" width="190" height="100" rx="16" class="box"/>
  <text x="514" y="362" class="t">告警状态</text>
  <text x="496" y="392" class="s">pending / firing</text>
  <path d="M802 242 C760 292 670 318 622 330" class="line"/>

  <rect x="722" y="330" width="190" height="100" rx="16" class="box"/>
  <text x="768" y="362" class="t">通知渠道</text>
  <text x="752" y="392" class="s">分组 / 抑制 / 路由</text>
  <path d="M656 380 H722" class="line"/>

  <rect x="44" y="468" width="868" height="34" rx="10" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="66" y="490" class="s">排障定位：无指标先查暴露与发现；告警未到达先区分规则是否触发，再查 Alertmanager 路由。</text>
</svg>
