Skip to content

RUM-18142: Add setAnrTriggerEnabled opt-out API for ANR-triggered profiling - #3729

Open
ambushwork wants to merge 1 commit into
developfrom
yilu/rum-18142/anr-trigger-opt-out-api
Open

RUM-18142: Add setAnrTriggerEnabled opt-out API for ANR-triggered profiling#3729
ambushwork wants to merge 1 commit into
developfrom
yilu/rum-18142/anr-trigger-opt-out-api

Conversation

@ambushwork

Copy link
Copy Markdown
Member

What does this PR do?

Adds a new ProfilingConfiguration.Builder.setAnrTriggerEnabled(Boolean) API (default true) allowing customers to opt out of
ANR-triggered profiling.

Why

  • Billing: ANR-triggered profiles are uploaded and billed as profiling sessions. Customers now have a choice to disable them.
  • Trigger conflicts: Customers registering their own ProfilingTriggers can disable the SDK's ANR trigger to avoid cleanup conflicts.

Motivation

RUM-18142

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@ambushwork

Copy link
Copy Markdown
Member Author

@codex review

@datadog-official

datadog-official Bot commented Aug 19, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 92.31%
Overall Coverage: 71.74% (-0.06%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: bd29d30 | Docs | View more details | Give us feedback!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35ed072187

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ambushwork
ambushwork force-pushed the yilu/rum-18142/anr-trigger-opt-out-api branch from 35ed072 to bd29d30 Compare August 19, 2026 11:03
@ambushwork
ambushwork marked this pull request as ready for review August 19, 2026 13:08
@ambushwork
ambushwork requested review from a team as code owners August 19, 2026 13:08
fun setApplicationLaunchSampleRate(Float): Builder
fun setContinuousSampleRate(Float): Builder
fun useCustomEndpoint(String): Builder
fun setAnrTriggerEnabled(Boolean): Builder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe enableAnrTrigger to be consistent with similar APIs that enable/disable something? but probably we don't have strict consistency anyway

synchronized(this) {
this.callback = callback
if (buildSdkVersionProvider.isAtLeastBaklava) {
if (buildSdkVersionProvider.isAtLeastBaklava && anrTriggerEnabled) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we going to consume the actual profile in another PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't consume it until the system trace support is deployed on profiling-backend.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I don't think it makes sense to ship this PR alone, without consuming profile.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well this API currently just provides a way to opt-out the trigger registration, but indeed exposing the API might be misleading. we can put this on hold since it doesn't block any incoming development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants