Skip to content

✨ [RUM-18194] default RUM service to the applicationId - #4979

Open
mormubis wants to merge 4 commits into
mainfrom
adlrb/rum-18194-default-service
Open

✨ [RUM-18194] default RUM service to the applicationId#4979
mormubis wants to merge 4 commits into
mainfrom
adlrb/rum-18194-default-service

Conversation

@mormubis

@mormubis mormubis commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Motivation

RUM events from apps that never set service arrive with no service attribution at all. The mobile SDKs already fall back to something sensible (iOS uses the bundle identifier, Android the manifest application ID), browser was the odd one out.

Changes

When service is not configured, it now falls back to the applicationId.

The fallback is applied after the allowedTracingUrls check, not before, so tracing still refuses to start without an explicitly configured service. That check would otherwise become unreachable and apps would silently start injecting trace headers pointing at a service name that matches nothing in APM.

Logs is untouched. It has no applicationId of its own, and RumInternalContext doesn't carry service, so nothing leaks across when both SDKs run.

Test instructions

  • Set applicationId: '0a1b2c3d-4e5f-6789-abcd-ef0123456789' in sandbox/index.html and leave service out
  • Run yarn dev and open http://localhost:8080
  • In the console, run window.__ddBrowserSdkExtensionCallback = (msg) => console.log(msg.payload.type, msg.payload.service, msg.payload.ddtags)
  • Reload and click around
  • Check RUM events have service: '0a1b2c3d-...' and ddtags contains service:0a1b2c3d-...
  • Check DD_RUM.getInitConfiguration().service is still undefined, the default should not leak into the getter
  • Run DD_LOGS.logger.info('test')
  • Check the log has no service and its ddtags is only sdk_version:dev
  • Add allowedTracingUrls: ['http://localhost:8080'] and remove service
  • Check init still fails with "Service needs to be configured when tracing is enabled"

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change. DEFAULT_RUM_CONFIGURATION sets no service, so profiling.scenario.ts now asserts the defaulted value end to end in tags_profiler.
  • Updated documentation and/or relevant AGENTS.md file

When `service` is not configured, fall back to the `applicationId` so RUM
events are always attributed to a service. Applied after the tracing check,
which still requires an explicitly configured service.
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 181.57 KiB 181.60 KiB +35 B +0.02%
Rum Profiler 8.43 KiB 8.43 KiB 0 B 0.00%
Rum Recorder 22.31 KiB 22.31 KiB 0 B 0.00%
Logs 57.63 KiB 57.63 KiB 0 B 0.00%
Rum Salesforce N/A 139.62 KiB N/A N/A N/A
Rum Slim 139.58 KiB 139.62 KiB +35 B +0.02%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%
Rum Shopify N/A 202.43 KiB N/A N/A N/A
Rum-shopify Profiler N/A 8.43 KiB N/A N/A N/A
Rum-shopify Recorder N/A 3.72 KiB N/A N/A N/A

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Aug 25, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.13% (+0.00%)

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

The test fixture app id contained an uppercase character, which is forbidden
in tags, so every spec building tags emitted a sanitization warning. CI fails
on unexpected console output, unlike the local runner.

The profiling e2e asserts the exact tags_profiler string, which now carries
the defaulted service.
@mormubis
mormubis marked this pull request as ready for review August 25, 2026 13:52
@mormubis
mormubis requested a review from a team as a code owner August 25, 2026 13:52
@mormubis
mormubis marked this pull request as draft August 25, 2026 13:52
@mormubis
mormubis marked this pull request as ready for review August 25, 2026 14:00

@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: dfb1e8bda3

ℹ️ 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".


return {
...config,
service: config.service || config.applicationId,

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 Badge Avoid defaulting bridge sessions to the placeholder application ID

issue: When a mobile/React Native event bridge is present and the web initialization omits service, overrideInitConfigurationForBridge() first replaces the application ID with the synthetic 00000000-aaaa-0000-aaaa-000000000000; this fallback then emits that placeholder as the service on every forwarded RUM event and in profile tags. That prevents these hybrid sessions from retaining an absent service for the native SDK's application-level default and collapses their attribution under the placeholder, so bridge configurations should preserve an omitted service unless the customer explicitly supplied one.

Useful? React with 👍 / 👎.

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