Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

span view / trace view drop span details: trace-items schema mismatch

未关闭 适合新手
#1,471 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
api, cli

调研方向

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
  1. sentry span view <trace-id> <segment-span-id> (or sentry 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/toolkit 的其他 Issue

查看 getsentry/toolkit 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。