<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="680" viewBox="0 0 1200 680" role="img" aria-label="异步调用链路边界与断点位置">
  <defs>
    <marker id="arrow" markerWidth="12" markerHeight="12" refX="10" refY="6" orient="auto">
      <path d="M2 2 L10 6 L2 10 Z" fill="#2563eb"/>
    </marker>
    <style>
      .bg{fill:#f8fafc}.card{fill:#ffffff;stroke:#cbd5e1;stroke-width:2}.warn{fill:#fff7ed;stroke:#fb923c;stroke-width:2}.title{font-size:28px;font-weight:700;fill:#0f172a}.label{font-size:20px;font-weight:700;fill:#1e293b}.text{font-size:16px;fill:#475569}.small{font-size:14px;fill:#64748b}.line{stroke:#2563eb;stroke-width:3;fill:none;marker-end:url(#arrow)}.dash{stroke:#fb923c;stroke-width:3;stroke-dasharray:8 7;fill:none}.pill{fill:#dbeafe;stroke:#60a5fa;stroke-width:1.5}
    </style>
  </defs>
  <rect class="bg" width="1200" height="680" rx="28"/>
  <text x="100" y="86" class="title">异步链路边界与断点定位</text>
  <text x="100" y="120" class="text">先判断上下文在哪个边界丢失，再决定修生产端、队列还是消费者</text>

  <rect x="70" y="170" width="180" height="140" rx="18" class="card"/>
  <text x="105" y="215" class="label">入口请求</text>
  <text x="100" y="250" class="text">生成 Trace</text>
  <text x="100" y="278" class="small">HTTP / gRPC</text>

  <rect x="310" y="170" width="190" height="140" rx="18" class="card"/>
  <text x="348" y="215" class="label">生产端</text>
  <text x="345" y="250" class="text">注入上下文</text>
  <text x="345" y="278" class="small">traceparent</text>

  <rect x="560" y="170" width="190" height="140" rx="18" class="warn"/>
  <text x="600" y="215" class="label">消息队列</text>
  <text x="595" y="250" class="text">保留消息属性</text>
  <text x="595" y="278" class="small">topic / offset</text>

  <rect x="810" y="170" width="190" height="140" rx="18" class="card"/>
  <text x="848" y="215" class="label">消费者</text>
  <text x="845" y="250" class="text">提取父上下文</text>
  <text x="845" y="278" class="small">consumer span</text>

  <rect x="505" y="420" width="210" height="120" rx="18" class="card"/>
  <text x="555" y="466" class="label">日志关联</text>
  <text x="540" y="500" class="text">trace_id + message_id</text>

  <path d="M250 240 H310" class="line"/>
  <path d="M500 240 H560" class="line"/>
  <path d="M750 240 H810" class="line"/>
  <path d="M405 310 C430 390 500 420 580 430" class="dash"/>
  <path d="M905 310 C860 390 760 420 690 430" class="dash"/>

  <rect x="300" y="360" width="180" height="54" rx="27" class="pill"/>
  <text x="328" y="394" class="text">断点1：未注入</text>
  <rect x="520" y="360" width="190" height="54" rx="27" class="pill"/>
  <text x="548" y="394" class="text">断点2：属性丢失</text>
  <rect x="750" y="360" width="195" height="54" rx="27" class="pill"/>
  <text x="778" y="394" class="text">断点3：未提取</text>

  <rect x="120" y="560" width="960" height="70" rx="18" fill="#e0f2fe" stroke="#38bdf8" stroke-width="2"/>
  <text x="150" y="604" class="label">排查原则：入口 Trace 正常时，按生产端注入 → 队列保留 → 消费端提取逐段验证</text>
</svg>
