span view / trace view drop span details: trace-items schema mismatch
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Issue 指出了 CLI 中 span 详情请求和响应的 schema,但没有指定源文件或测试。首先找到解析 /trace-items/ 响应的代码,以及 sentry span view 或 sentry trace view 的测试;使用值为字符串的 int 属性复现问题。当 span 详情能够加载属性和 segment 事件,并且有测试覆盖此回归问题时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Environment
sentry CLI 0.45.0 (Homebrew, macOS 27). Org on the de.sentry.io region, iOS project on sentry-cocoa 9.29.2. Same behaviour on 0.44.1.
Steps to Reproduce
sentry span view <trace-id> <segment-span-id>(orsentry trace view <trace-id> --json) on a trace with a transaction.
For comparison:
sentry api "projects/<org>/<project>/trace-items/<span>/?item_type=spans&trace_id=<trace>&statsPeriod=14d".
Expected Result
Step 1 shows the span's attributes and, for the segment span, the embedded transaction event (breadcrumbs, contexts, extra), the same data the web trace view shows for that span.
Actual Result
Step 1 logs [api.traces] WARN Could not fetch details for span <id> for every span and drops the item; with --json the spans carry no attributes and no event. Calling through the sentry api returns the full item (61 attributes plus event).
The cause seems to be in the CLI. The following is an AI analysis of the bundle code:
`R7()` requests `/projects/${org}/${project}/trace-items/${id}/` with `{trace_id, item_type}` and parses the response with `fq={itemId,timestamp,attributes:array(V_e)}`, where `V_e` is a discriminated union on `type`: `{type:"str",value:string}`, `{type:"int",value:number}`, `{type:"float",value:number}`, `{type:"bool",value:boolean}`, `{type:"array",value:array}`.
The API returns int attributes as strings, so the schema throws, and the code then catches every throw and logs a generic warning.
Attributes typed int with string values in the response for one segment span:
| name | type | value |
|---|---|---|
mobile.frozen_frames |
int | "0" |
mobile.slow_frames |
int | "10" |
mobile.total_frames |
int | "232" |
project_id |
int | "4510969405374544" |
tags[thread.id,number] |
int | "259" |
Related: getsentry/toolkit#1474 (typed custom attributes break log list/view --fields, the same class of mismatch).
- 主要语言
- TypeScript
- 星标
- 938
- 派生
- 166
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 172
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/toolkit 的其他 Issue
-
bug MCP
难度 2/5 1-3 小时 新手友好度 75/100
getsentry/toolkit#1621 · 1 条评论 ·
维护者通常 1 天内回复
-
bug MCP
难度 2/5 1-3 小时 新手友好度 73/100
getsentry/toolkit#1618 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
getsentry/toolkit#1632 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
getsentry/toolkit#1630 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
getsentry/toolkit#1623 · 2 条评论 ·
维护者通常 1 天内回复
查看 getsentry/toolkit 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
juice-shop/juice-shop#3706 ·
维护者通常 1 天内回复
-
sbx up from a subfolder silently pushes the whole work tree可能已有人在做 @pdettori 今天认领。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
outline/outline#14348 · 1 条评论 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复