Skip to content

feat(rum,logs): Add trackViews, getCurrentSessionId and the logger service option - #5382

Draft
mormubis wants to merge 1 commit into
adlrb/RUM-20325-common-names-logsfrom
adlrb/RUM-20325-common-names-new-apis
Draft

mormubis wants to merge 1 commit into
adlrb/RUM-20325-common-names-logsfrom
adlrb/RUM-20325-common-names-new-apis

Conversation

@mormubis

@mormubis mormubis commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Motivation

Sixth PR of the common names stack (#5377). Other SDKs have these APIs and Browser doesn't.

Refs: RUM-20325, RUM-19580

Changes

trackViews is the common name for automatic view tracking, with the opposite meaning of trackViewsManually. trackViews: false tracks views manually, and trackViewsManually: true still wins. I did it that way because the framework plugins set trackViewsManually in onInit, and I didn't want a customer's trackViews: true to break them. I didn't deprecate trackViewsManually yet. What do you think?

getCurrentSessionId() on datadogRum and datadogLogs returns the id of the current session, even when it's not sampled. It's undefined before init. I didn't add a telemetry usage key, because that needs a rum-events-format change first.

createLogger accepts service, which overrides the service init option for that logger.

Test instructions

Run yarn test:unit packages/browser-rum-core/src/domain/configuration packages/browser-rum-core/src/boot/rumPublicApi.spec.ts packages/browser-logs/src/boot. The manual views init e2e scenario uses trackViews: false.

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

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔁 Datadog re-ran unit-bs: [edge] after it failed. The re-run passed. View in Datadog

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

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.

1 participant