Skip to content

🔊 [RUM-18974] Report init context usage in telemetry configuration - #5277

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
grigory.gusarov/init-context-telemetry
Nov 17, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
grigory.gusarov/init-context-telemetry

Conversation

@gogusarov

@gogusarov gogusarov commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Follow-up of #5176, which added the initContext parameter to init() to set user and account information at initialization. As suggested in #5176 (comment), report its usage in the configuration telemetry, without leaking any customer data.

The schema change is DataDog/rum-events-format#460.

Changes

  • Sync rum-events-format to the latest master (6c7c08f) to get the new init_context field. This also brings unrelated upstream additions (track_ipc_resources, message resource type, unreal source, attach-element-stack usage feature).
  • Add serializeInitContext in browser-core. It only reports whether each init context property is provided with a non-empty value, never the values: init_context: { has_user: true, has_account: false }. Unknown properties passed by JS customers are ignored.
  • Add init_context to the configuration telemetry sent by the RUM and Logs pre-start strategies.
  • Add a type-level guarantee that each InitContext key is serialized as has_<snake_case_key> and exists in the telemetry schema (MapInitContextKey / ExtractTelemetryInitContext). Like the existing MapInitConfigurationKey / ExtractTelemetryConfiguration, these types are only used in tests, because template literal types aren't supported by TS 3.8. Open to moving the check to the source code if you prefer.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

🤖 Generated with Claude Code

Report whether the init context properties are provided when
initializing the SDK, as `init_context: { has_user, has_account }`
booleans, without sending their values.

Sync rum-events-format to get the new `init_context` field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gogusarov
gogusarov requested a review from a team as a code owner November 12, 2026 18:38
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum Salesforce 192.62 KiB 192.71 KiB +96 B +0.05% ✅
Rum 192.60 KiB 192.69 KiB +96 B +0.05% ✅
Rum Salesforce Profiler 8.01 KiB 8.01 KiB 0 B 0.00% ✅
Rum Profiler 8.01 KiB 8.01 KiB 0 B 0.00% ✅
Rum Salesforce Recorder 32.62 KiB 32.62 KiB 0 B 0.00% ✅
Rum Recorder 32.62 KiB 32.62 KiB 0 B 0.00% ✅
Logs 60.22 KiB 60.35 KiB +130 B +0.21% ✅
Rum Slim 148.53 KiB 148.63 KiB +96 B +0.06% ✅
Worker 24.23 KiB 24.23 KiB 0 B 0.00% ✅
Rum Shopify 223.66 KiB 223.75 KiB +96 B +0.04% ✅
Rum Shopify Profiler 8.00 KiB 8.00 KiB 0 B 0.00% ✅
Rum Shopify Recorder 4.85 KiB 4.85 KiB 0 B 0.00% ✅

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 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: PASS

More details

RUM and Logs configuration telemetry emit only boolean indicators for init-context user and account properties; customer values and unknown properties are excluded.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit c6b204b

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 78.09% (+0.02%)

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	package.json
#	yarn.lock
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants