Register navigation, route and deep-link attributes in Sentry Conventions

未关闭
#7,052 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
react-native, typescript

调研方向

Start with the Sentry Conventions PR and the dependency issue for @sentry/conventions; the issue says that PR needs code-owner approval and a three-business-day wait. Then inspect src/js/tracing/semanticAttributes.ts and the listed instrumentation files for the attribute literals. Done when the conventions are merged with backfill aliases for renamed keys and the SDK uses the registered constants.

由索引模型根据 Issue 内容生成。

描述

React-Native Task

The React Navigation, Expo Router and React Native Navigation instrumentations send attributes that aren't in Sentry Conventions. Register them (or map them to existing keys), then switch the SDK to the constants.

Keys

  • route.name, route.key, route.component_id, route.component_type, route.has_been_seen, route.path, route.url, route.href, route.initial_display_fallback
  • previous_route.name, previous_route.key, previous_route.component_id, previous_route.component_type
  • routing.instrumentation
  • navigation.method, navigation.trigger, navigation.action_type
  • deeplink.url, deeplink.dispatch_delay_ms

Open questions for the Sentry Conventions PR

  • Namespace: top-level route is deprecated in favour of http.route, and previous_route is a single leaf attribute. The proposal is navigation.route.* (navigation.route.id already exists) and navigation.previous_route.*, with the SDK renaming to them under backfill aliases.
  • Units: Sentry Conventions keeps units out of key names, so deeplink.dispatch_delay_ms likely becomes deeplink.dispatch_delay with the unit in its definition.
  • Scrubbing: set apply_scrubbing on route.url, route.href and deeplink.url. The SDK already gates them on sendDefaultPii or sanitizes them.
  • Don't use navigation.type: it's deprecated in favour of router.navigation.type.

Acceptance criteria

  • The Sentry Conventions PR is merged (it needs one code-owner approval, then a 3-business-day wait).
  • The SDK uses the registered keys through @sentry/conventions constants.
  • Any renamed keys are covered by backfill aliases in Sentry Conventions.
Agent notes
  • Local constants: src/js/tracing/semanticAttributes.ts.
  • Literal keys in:
    • src/js/tracing/reactnavigation.ts: route.path/route.url at lines 825–826, deep-link attributes at lines 958–963.
    • src/js/tracing/expoRouter.ts: route.href, navigation.method.
    • src/js/tracing/expoRouterErrorBoundary.tsx: route.path.
    • src/js/tracing/reactnativenavigation.ts.
    • src/js/tracing/onSpanEndUtils.ts.
  • Depends on the @sentry/conventions dependency issue in this project for the constant swap.
主要语言
TypeScript
星标
1.8k
派生
371
平均合并
22 小时 3 分钟
30 天内合并 PR
106

环境准备

从这里开始

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

getsentry/sentry-react-native 的其他 Issue

查看 getsentry/sentry-react-native 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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