Expose Android app startup Activity filtering in the React Native SDK
维护者通常 2 天内回复
@sbarrio 已经在做这个了。
开始于 2026年10月9日。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- kotlin, react-native, typescript
- 领域
- mobile, observability
调研方向
Start with the workaround in the issue, which overrides buildRumConfiguration() in DdSdkNativeInitialization and calls setAppStartupActivityPredicate on the Android RumConfiguration.Builder. Trace how a TypeScript RUM option would travel through the native bridge into DdSdkConfiguration, and decide whether the field is optional with the current behavior kept as the default. Done means a new androidAppStartupActivityClassNames option that filters startup Activities on Android, with the default unchanged and tests covering both cases.
由索引模型根据 Issue 内容生成。
描述
Feature description
Use case
Android apps can contain secondary Activities that do not represent an app startup. Datadog may treat these Activities as warm starts. We observed time_to_initial_display warm-start vitals lasting up to 58 seconds while the user was already navigating and interacting with the app. These invalid measurements significantly inflate Android startup SLOs.
How the SDK currently delivers
@datadog/[email protected] uses [email protected], which supports RumConfiguration.Builder.setAppStartupActivityPredicate.
However, the React Native SDK does not expose a way to configure that predicate. React Native consumers therefore cannot distinguish their primary React Activity from authentication or other auxiliary Activities without patching the package’s native initialization code.
What we would like to see
Expose an Android-specific React Native configuration option that limits app startup tracking to selected Activity class names:
configuration.androidAppStartupActivityClassNames = [
'com.example.MainActivity'
];
When unspecified, the SDK could preserve its current behavior for backward compatibility.
Proposed solution
The React Native SDK could:
- Add
androidAppStartupActivityClassNames?: string[]to its RUM configuration. - Serialize it through the native configuration bridge.
- Parse it in the Android
DdSdkConfiguration. - Apply it while constructing
RumConfiguration:
configuredActivityClassNames?.let { classNames ->
configBuilder.setAppStartupActivityPredicate { activity ->
activity.javaClass.name in classNames
}
}
An alternative would be an Android-native extension point that applications can use to customize RumConfiguration.Builder before RUM initialization.
Other relevant information
Our current workaround patches DdSdkNativeInitialization.buildRumConfiguration():
private const val APP_STARTUP_ACTIVITY_CLASS_NAME =
"com.example.MainActivity"
@OptIn(ExperimentalRumApi::class)
private fun buildRumConfiguration(
configuration: DdSdkConfiguration
): RumConfiguration {
// Existing configuration...
configBuilder.setAppStartupActivityPredicate { activity ->
activity.javaClass.name == APP_STARTUP_ACTIVITY_CLASS_NAME
}
// Existing configuration...
}
- 主要语言
- TypeScript
- 星标
- 145
- 派生
- 65
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 19
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DataDog/dd-sdk-reactnative 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
DataDog/dd-sdk-reactnative#1495 ·
维护者通常 2 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 62/100
DataDog/dd-sdk-reactnative#1486 · 3 条评论 ·
维护者通常 2 天内回复
-
GraphQL variables with non-ASCII contents will make Apollo Client request throw error可能已有人在做 @cdn34dd 于 9 天前认领。 未关闭awaiting response bug
难度 4/5 3-5 天 新手友好度 42/100
DataDog/dd-sdk-reactnative#1482 · 2 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 2 天内回复
-
Interaction tracking records nothing: the babel plugin's injected import makes Metro bundle a second copy of the SDK, so DdBabelInteractionTracking.config is set on a different class than instrumented handlers call可能已有人在做 @cdn34dd 于 7 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
DataDog/dd-sdk-reactnative#1377 · 1 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 2 天内回复
-
Babel plugin emits untransformed JSX when a tracked component has .map() children, breaking the Hermes build可能已有人在做 @cdn34dd 于 7 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 76/100
DataDog/dd-sdk-reactnative#1353 · 1 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 DataDog/dd-sdk-reactnative 的全部 Issue
相似的 Issue
-
`cf complete zsh >> .zshrc` fails on vanilla zsh可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
cloudflare/cf#340 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1 小时以内 新手友好度 75/100
StoDevX/AAO-React-Native#8785 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 75/100
-
bnv-manager-v2: accept_invite creates the Mailcow domain admin before the commit可能已有人在做 @myOmikron 今天认领。 未关闭bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 82/100