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

Expose Android app startup Activity filtering in the React Native SDK

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

维护者通常 2 天内回复

@sbarrio 已经在做这个了。

开始于 2026年10月9日。

评估

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

调研方向

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 内容生成。

描述

enhancement
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:

  1. Add androidAppStartupActivityClassNames?: string[] to its RUM configuration.
  2. Serialize it through the native configuration bridge.
  3. Parse it in the Android DdSdkConfiguration.
  4. 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

环境准备

从这里开始

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

DataDog/dd-sdk-reactnative 的其他 Issue

查看 DataDog/dd-sdk-reactnative 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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