Skip to content

[RUM-20336] feat: Add Vega RUM APIs and global attributes - #1578

Open
cdn34dd wants to merge 2 commits into
carlosnogueira/RUM-20035/add-vega-sdk-packagefrom
carlosnogueira/RUM-20336/add-vega-rum-and-global-attributes
Open

cdn34dd wants to merge 2 commits into
carlosnogueira/RUM-20035/add-vega-sdk-packagefrom
carlosnogueira/RUM-20336/add-vega-rum-and-global-attributes

Conversation

@cdn34dd

@cdn34dd cdn34dd commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds manual RUM APIs to the Vega package for views, actions, resources, errors, feature operations, session control, and view/global attributes.

The JavaScript wrappers call the C++ SDK through Kepler TurboModules. Native modules resolve on use, attribute values keep their types, and bridge failures do not reject into app code. Native calls use the SDK's event queue to preserve their order.

Motivation

Vega apps need to record RUM events and attach context through JavaScript. This adds the APIs covered by RUM-20336, building on the native foundation in RUM-20035.

Additional Notes

  • HTTP methods, action types, and error sources are matched without case sensitivity, consistent with the core bridges. Native regression tests cover uppercase, lowercase, and mixed-case tokens.
  • Stacked on [RUM-20335] Add Vega SDK package #1550 (RUM-20035). SDK initialization and automatic instrumentation are handled separately in RUM-20335.
  • Includes regenerated Kepler bindings, wrapper tests, native attribute-conversion tests, and a fix for the TypeScript declaration output path.
  • C++ SDK 0.7.0 does not support custom timings, view loading times, feature flag evaluations, session ID lookup, or custom error fingerprints. These limitations and the use of native event timestamps are documented in the README.
  • Validation passed: yarn test --runInBand --watchman=false (1,977 tests; one skipped), yarn prepare, and yarn lint --ignore-pattern '**/android/build/**' (no errors; 12 existing warnings).
  • Native host tests passed. Release builds passed for aarch64, armv7, and x86_64. Device smoke testing has not been run.
  • The change totals 1,243 added/removed lines, including 156 lines of generated bindings.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • 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)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@cdn34dd
cdn34dd added this pull request to stack #1580 November 24, 2026 17:44

@cursor cursor 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.

PR Review — Quality: 3.5 / 5 · Review load: Broad (~1–1.5h)

The manual RUM wrappers, attribute conversion, and documented C++ SDK 0.7.0 limits match the implementation. Merge after the enum parsers case-fold resource methods, action types, and error sources the way the iOS and Android bridges do; DdRum.startResource(key, 'post', url) is recorded as GET.

Customer impact: Medium — Vega apps that call the new manual APIs record RUM events and global attributes. Other platforms are unchanged.

Concern
Manual RUM event recording, including enum mapping and ignored timestamps Risky
Global and view attribute propagation into the C++ SDK and AttributesSingleton Risky
Packaging, codegen registration, and declaration root Routine

Assessment: View, action, resource, error, session, and feature-operation calls reach withRum in bridge order, drop timestamps and fingerprints as the README describes, and resolve without throwing when the module or RUM monitor is missing. Singular attributes unwrap { value }, and AttributesSingleton updates only when the native call does not return false, which the Jest test locks in. Native host tests cover type conversion and the uppercase tokens. They do not cover a lowercase method or action, so the wrong classification above would stay green. The callNative / withRum split is a clear success bit rather than a second attribute store. Kepler's Promise header is not in this repo, so delivery of that boolean across the bridge is inferred from the resolve call and the JavaScript check, not from the marshaller.

Review load — Broad (~1–1.5h): The two boundaries are the RUM call contract across JavaScript and C++, and attribute state shared with AttributesSingleton. Generated specs repeat those signatures. One reviewer can take the wrappers and the native bridge together.

Findings

  • [Minor · Correctness] Case-sensitive method and action mapping — startResource(key, 'post', url) is stored as GET, and lowercase action and error strings become Custom. Comment on packages/react-native-vega/kepler/turbo-modules/DdRum.cpp.
Open in Web View Automation 

Sent by Cursor Automation: dd-sdk-react-native reviews

@cursor cursor 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.

PR Review — Quality: 5.0 / 5 · Review load: Broad (~1–1.5h)

The ASCII case-fold for actions, resource methods, and error sources is in place, and the host test fails if post, tap, or network fall through to the old defaults. Quality moved to 5.0 because that misclassification was the remaining issue. This is ready to merge as-is.

Customer impact: Medium — Vega apps that call the new manual RUM APIs record events and global attributes. Other platforms are unchanged. Lowercase methods, actions, and error sources now follow the same classification as iOS and Android.

Concern
Manual RUM event recording, including enum mapping and ignored timestamps Risky
Global and view attribute propagation into the C++ SDK and AttributesSingleton Risky
Packaging, codegen registration, and declaration root Routine

Assessment: uppercaseAscii runs before the action, method, and error-source comparisons, so startResource(key, 'post', url) is a POST and tap / network stay Tap and Network. Unknown methods still default to GET. checkCasings locks uppercase, lowercase, and title-case spellings and would throw on the previous exact-match parsers. Resource kinds stay exact lowercase, matching ResourceKind and iOS. BACK remains Custom, as the README already states. Attribute propagation and packaging are unchanged from the previous pass.

Review load — Broad (~1–1.5h): The two boundaries are the RUM call contract across JavaScript and C++, and attribute state shared with AttributesSingleton. One reviewer can take the wrappers and the native bridge together.

This run assessed the delta and revalidated the prior case-mapping finding. That thread is addressed: #1578 (comment)

Open in Web View Automation 

Sent by Cursor Automation: dd-sdk-react-native reviews

@cdn34dd
cdn34dd marked this pull request as ready for review November 25, 2026 10:55
@cdn34dd
cdn34dd requested review from a team as code owners November 25, 2026 10:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T10:56:54.270525Z 699538f Draft marked ready
🔒 Security Review ✅ Completed 2026-11-25T10:59:08.585835Z 699538f Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 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.

Bits Code Review: WARN

DdRum is registered in C++ but omitted from Kepler’s autolink metadata, creating a risk that module discovery silently drops manual RUM calls. Native loader behavior could not be verified.

Open Bits AI session

🤖 Bits Code Review · Commit 699538f

}

export const getNativeDdRum = (): DdRum | null =>
TurboModuleRegistry.get<DdRum>('DdRum') ?? null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Declare DdRum in Kepler autolink metadata

The new lookup requests DdRum, but react-native.config.js still advertises only turbomodules: ['DdSdk']. If Kepler resolves modules through the generated name-to-library mapping, it cannot discover DdRum, and callNative silently drops manual RUM calls. Add DdRum to the autolink list alongside its C++ registration. Wrapper tests mock the registry; the native loader implementation was unavailable, so this failure path remains unconfirmed.

React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it

What each reaction means
  • 👍 Useful: correct, and you're fixing it or will.
  • 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
  • 😕 Unclear: you can't tell what it means or why it matters.
  • 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.

🤖 Bits Code Review · Open Bits AI session

@maciejburda
maciejburda requested a review from sbarrio November 25, 2026 16:53

@buraizu buraizu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left some inline edit suggestions for the doc, but let me know if you have any questions or feedback

- Event mappers, JavaScript error enrichment, and tracing helpers are not provided
by this manual wrapper.

Attribute conversion tests can run on the host with dd-sdk-cpp 0.7.0 and the Vega

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggesting to use code font to mark dd-sdk-cpp

Suggested change
Attribute conversion tests can run on the host with dd-sdk-cpp 0.7.0 and the Vega
Attribute conversion tests can run on the host with `dd-sdk-cpp` 0.7.0 and the Vega

Comment on lines +6 to +7
native upload thread. Manual RUM and global attribute APIs are available; SDK
initialization and automatic instrumentation are added separately.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggesting a minor clarification

Suggested change
native upload thread. Manual RUM and global attribute APIs are available; SDK
initialization and automatic instrumentation are added separately.
native upload thread. This package provides manual RUM and global attribute APIs.
It does not include SDK initialization or automatic instrumentation.

Import `DdRum` and `DdSdkReactNative` from `@datadog/mobile-react-native-vega`.
After RUM is initialized, use `DdRum` to start and stop views, record discrete or
continuous actions, start and stop resources, report errors, update view
attributes, stop a session, report full app display, and track feature operations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
attributes, stop a session, report full app display, and track feature operations.
attributes, stop a session, report when the app is fully displayed, and track feature operations.


`DdSdkReactNative.addAttribute`, `addAttributes`, `removeAttribute`, and
`removeAttributes` update global RUM attributes and the shared JavaScript context.
View attributes take precedence over global attributes until removed or the view

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
View attributes take precedence over global attributes until removed or the view
View attributes take precedence over global attributes until they are removed or the view

View attributes take precedence over global attributes until removed or the view
ends. JSON-compatible values retain their types, including nested objects,
arrays, numbers, booleans, and null. Singular attribute calls wrap the value for
the bridge; that wrapper is removed before passing it to the C++ SDK.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
the bridge; that wrapper is removed before passing it to the C++ SDK.
the bridge, and the bridge removes that wrapper before passing the value to the C++ SDK.

arrays, numbers, booleans, and null. Singular attribute calls wrap the value for
the bridge; that wrapper is removed before passing it to the C++ SDK.

Calls resolve safely when the native module or RUM feature is unavailable. They

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggesting a minor clarification, but please confirm this is accurate

Suggested change
Calls resolve safely when the native module or RUM feature is unavailable. They
`DdRum` and `DdSdkReactNative` calls resolve without error when the native module or RUM feature is unavailable. They

- `getCurrentSessionId` resolves to `undefined`; the SDK does not expose a getter.
- Event timestamps come from the native SDK. Optional `timestampMs` arguments are
accepted for compatibility but do not override that clock.
- Custom error fingerprints are accepted but are not supported by the native SDK.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Custom error fingerprints are accepted but are not supported by the native SDK.
- Custom error fingerprints are accepted but ignored, because the native SDK does not support them.

This branch has not been deployed

No deployments
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.

2 participants