local-ttft-platform-evidence.json 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. {
  2. "collectedAt": "2026-09-15T02:25:00+08:00",
  3. "source": "阶段 0 平台验收:真实 desktop E2E → OTLP → 北京 ARMS/SLS,随后只读查询核对",
  4. "scope": "本文件只记录平台侧验收;本地 OTLP 出口证据见 local-ttft-evidence.json 与 local-ttft-diagnostics-evidence.json",
  5. "platform": {
  6. "region": "cn-beijing",
  7. "project": "arms-project-placeholder",
  8. "traceStore": "logstore-tracing",
  9. "metricStore": "metricstore-apm-metrics-custom",
  10. "serviceName": "zcode-local-ttft"
  11. },
  12. "endpointProbe": {
  13. "note": "接入值取自 CI 变量 ZCODE_PACKAGED_AGENT_OTEL_ENDPOINT/_HEADERS,密钥不入库;下表只记录路径形态与状态码",
  14. "basePath": "/apm/trace/opentelemetry",
  15. "headerKeys": ["x-arms-license-key", "x-arms-project", "x-cms-workspace"],
  16. "results": [
  17. {
  18. "path": "/apm/trace/opentelemetry/v1/traces",
  19. "status": 200,
  20. "meaning": "Trace 侧现有拼接,可用"
  21. },
  22. {
  23. "path": "/apm/trace/opentelemetry/v1/metrics",
  24. "status": 200,
  25. "meaning": "Metric 侧 base+/v1/metrics 拼接可用;此前担心的路径不兼容风险不成立"
  26. },
  27. {
  28. "path": "/apm/metric/opentelemetry/v1/metrics",
  29. "status": 404,
  30. "meaning": "SLS 不使用独立 metric base"
  31. },
  32. {
  33. "path": "/apm/metrics/opentelemetry/v1/metrics",
  34. "status": 400,
  35. "meaning": "同上"
  36. }
  37. ],
  38. "conclusion": "同一个 OTLP base 同时接收 traces 与 metrics,桌面 main 不需要独立 metrics endpoint 注入通道"
  39. },
  40. "runs": [
  41. {
  42. "runId": "desktop-e2e-20260915020619919-p56853-722f219491dafb0d",
  43. "spec": "conversation-session-ttft-stages",
  44. "passed": 3,
  45. "failed": 0,
  46. "exitCode": 0
  47. },
  48. {
  49. "runId": "desktop-e2e-20260915021204704-p61755-cbf7df537b79ae11",
  50. "spec": "conversation-session-ttft-stages",
  51. "passed": 3,
  52. "failed": 0,
  53. "exitCode": 0
  54. },
  55. {
  56. "runId": "desktop-e2e-20260915021512862-p67329-8016dda6fb7d3237",
  57. "spec": "conversation-session-ttft-diagnostics",
  58. "passed": 6,
  59. "failed": 0,
  60. "exitCode": 0
  61. }
  62. ],
  63. "transport": {
  64. "mode": "E2E 运行时 env 注入 OTEL_EXPORTER_OTLP_ENDPOINT 指向本地接收器,接收器把原始 body/编码逐字转发到真实接入点",
  65. "forwardedRequests": 85,
  66. "forwardedFailures": 0,
  67. "byPath": { "/v1/traces": 55, "/v1/metrics": 30 },
  68. "allStatus": 200,
  69. "caveat": "转发字节与 exporter 直连一致,但打包版从 Finder/开始菜单启动的编译注入写入路径仍未验证(阶段 1)"
  70. },
  71. "traceAcceptance": {
  72. "serviceVisible": true,
  73. "rootSpanSamples": 12,
  74. "observationIdIsTraceId": {
  75. "observationId": "820f1085-7bf1-4b04-9229-c2625b11da47",
  76. "traceId": "820f10857bf14b049229c2625b11da47",
  77. "verified": true
  78. },
  79. "singleMessageWaterfall": {
  80. "observationId": "820f1085-7bf1-4b04-9229-c2625b11da47",
  81. "spanCount": 62,
  82. "rootMs": 701.7,
  83. "mainStagesMs": {
  84. "command_admission": 295.48,
  85. "model_request": 285.38,
  86. "request_prepare": 73.81,
  87. "output_return": 32.75,
  88. "renderer_prepare": 7.5,
  89. "execution_wait": 6.77
  90. },
  91. "mainStagesSumMs": 701.69,
  92. "reconciliation": "六个主阶段并集 701.69ms 对账根 701.70ms,与该样本 unattributed_ms=0 一致",
  93. "firstTextMs": 8450.5,
  94. "checkpointSpans": 31,
  95. "startedPointRecordsZeroDuration": true
  96. },
  97. "rootAttributesPresent": [
  98. "observation_id",
  99. "command_id",
  100. "input_id",
  101. "query_id",
  102. "turn_id",
  103. "product_turn_id",
  104. "logical_call_id",
  105. "request_id",
  106. "cli_instance_id",
  107. "session_id",
  108. "quality",
  109. "send_mode",
  110. "visibility",
  111. "first_output_kind",
  112. "unattributed_ms",
  113. "missing_stages",
  114. "truncated",
  115. "clock_error_ms",
  116. "timing_reliable"
  117. ],
  118. "sampleRootValues": {
  119. "quality": "complete",
  120. "send_mode": "idle",
  121. "visibility": "background_returned",
  122. "first_output_kind": "reasoning",
  123. "clock_error_ms": 5.02,
  124. "unattributed_ms": 0,
  125. "truncated": false
  126. }
  127. },
  128. "metricAcceptance": {
  129. "nameMapping": "OTel → Prometheus 不追加单位后缀,local-ttft-queries.md 的 zcode_local_ttft_* 默认名成立",
  130. "deltaTemporality": "sum_over_time 累加区间样本成立;未使用 rate/increase",
  131. "labelSet": {
  132. "observed": [
  133. "app_version",
  134. "os",
  135. "provider",
  136. "model",
  137. "quality",
  138. "send_mode",
  139. "visibility",
  140. "stage",
  141. "role",
  142. "outcome",
  143. "kind"
  144. ],
  145. "sampleValues": {
  146. "app_version": "3.12.1",
  147. "os": "darwin",
  148. "provider": "e2e-deepseek",
  149. "model": "deepseek-v4-flash"
  150. },
  151. "highCardinalityLeak": false
  152. },
  153. "queries": [
  154. {
  155. "name": "总样本 count",
  156. "promql": "sum(sum_over_time(zcode_local_ttft_duration_count[30m]))",
  157. "result": 12
  158. },
  159. {
  160. "name": "阶段样本 count",
  161. "promql": "sum(sum_over_time(zcode_local_ttft_stage_duration_count[30m]))",
  162. "result": 18,
  163. "note": "首个 stages run 的 3 次发送 × 6 阶段,无 attempt 放大"
  164. },
  165. {
  166. "name": "总 P50",
  167. "promql": "histogram_quantile(0.50, sum by (le) (sum_over_time(zcode_local_ttft_duration_bucket{quality=\"complete\"}[10m])))",
  168. "result": 1500.0,
  169. "note": "桶插值,非精确原始分位数"
  170. },
  171. {
  172. "name": "阶段 P95",
  173. "promql": "histogram_quantile(0.95, sum by (le,stage) (sum_over_time(zcode_local_ttft_stage_duration_bucket{quality=\"complete\"}[10m])))",
  174. "result": {
  175. "command_admission": 1850.0,
  176. "request_prepare": 4550.0,
  177. "model_request": 455.0,
  178. "output_return": 455.0,
  179. "execution_wait": 455.0,
  180. "renderer_prepare": 18.5
  181. }
  182. },
  183. {
  184. "name": "默认体验总 P95(前台+complete)",
  185. "promql": "histogram_quantile(0.95, sum by (le,send_mode) (sum_over_time(zcode_local_ttft_duration_bucket{quality=\"complete\",visibility=\"foreground\"}[30m])))",
  186. "result": { "idle": 9000.0, "queued": 4850.0 }
  187. },
  188. {
  189. "name": "默认体验样本数",
  190. "promql": "sum by (send_mode) (sum_over_time(zcode_local_ttft_duration_count{quality=\"complete\",visibility=\"foreground\"}[30m]))",
  191. "result": { "idle": 4, "queued": 1 }
  192. },
  193. {
  194. "name": "准备子阶段 P95(前台+complete)",
  195. "promql": "histogram_quantile(0.95, sum by (le,stage) (sum_over_time(zcode_local_ttft_preparation_duration_bucket{quality=\"complete\",visibility=\"foreground\"}[30m])))",
  196. "result": {
  197. "context": 937.5,
  198. "hooks": 875.0,
  199. "retry_wait": 1950.0,
  200. "user_confirmation": 485.0,
  201. "request_assembly": 8.75,
  202. "persistence": 4.64,
  203. "mcp": 0.95,
  204. "tools": 0.95
  205. }
  206. },
  207. {
  208. "name": "records by kind",
  209. "promql": "sum by (kind) (sum_over_time(zcode_local_ttft_records[30m]))",
  210. "result": {
  211. "start": 16,
  212. "first_output": 12,
  213. "first_text": 12,
  214. "excluded": 4,
  215. "checkpoint": 442
  216. }
  217. },
  218. {
  219. "name": "excluded by outcome",
  220. "promql": "sum by (outcome) (sum_over_time(zcode_local_ttft_records{kind=\"excluded\"}[30m]))",
  221. "result": { "cancelled": 2, "failed": 1, "guided": 1 }
  222. },
  223. {
  224. "name": "attempt by role/outcome",
  225. "promql": "sum by (role,outcome) (sum_over_time(zcode_local_ttft_attempt_duration_count[30m]))",
  226. "result": { "response/first_output": 12, "response/failed": 2 },
  227. "note": "重试的失败 attempt 与首输出 attempt 分别计数,主 TTFT 未被放大"
  228. },
  229. {
  230. "name": "no_output.wait by outcome",
  231. "promql": "sum by (outcome) (sum_over_time(zcode_local_ttft_no_output_wait_count[30m]))",
  232. "result": { "cancelled": 2, "failed": 1 }
  233. },
  234. {
  235. "name": "quality × visibility",
  236. "promql": "sum by (quality,visibility) (sum_over_time(zcode_local_ttft_duration_count[30m]))",
  237. "result": {
  238. "complete/foreground": 5,
  239. "complete/background_returned": 6,
  240. "complete/background": 1
  241. }
  242. }
  243. ],
  244. "droppedCounter": "本次未观察到 zcode.local_ttft.dropped 序列,即无容量/队列丢弃"
  245. },
  246. "ingestionLatency": {
  247. "method": "第二次 stages run 结束瞬间开始 5 秒间隔轮询,直到新样本可查",
  248. "traceVisibleAfterSeconds": 0,
  249. "metricVisibleAfterSeconds": 0,
  250. "interpretation": "E2E 结束时明细与聚合都已可查(首次轮询即命中,上界 <5s),优于明细秒到几十秒、聚合约 5 分钟的目标;这不是逐条从产生到可见的精确测量",
  251. "precise": false
  252. },
  253. "notVerified": [
  254. "ARMS/Trace Explorer 控制台界面上的瀑布渲染与跳转目视确认(本次全部通过只读 API 核对数据完整性)",
  255. "打包版从 Finder/开始菜单启动时的编译注入写入路径(阶段 1)",
  256. "明细 7 天 / 聚合 30 天保留期、容量与实际费用(阶段 3)",
  257. "灰度经服务端 client configs 下发后的端到端生效(阶段 2)",
  258. "Windows / Linux 实机"
  259. ],
  260. "sideEffects": {
  261. "productionWrites": "本次向生产遥测库写入 12 次发送的受控样本",
  262. "identification": "可按 provider=\"e2e-deepseek\" 与 model=\"deepseek-v4-flash\" 识别并排除;这些标签不会出现在真实用户样本中",
  263. "cleanup": "指标与 Trace 均按保留期自然过期,未做人工删除"
  264. }
  265. }