Skip to content

Conversation

@yannickadam
Copy link
Contributor

Motivation

When inspecting the RUM/Logs configuration using the Browser SDK extension, functions are shown as {empty object}.
image
This can mislead users to think that it's undefined / not present.

Changes

  • Pass function metadata when retrieving the SDKs configuration and display a snippet of the source code:
image - Fix an issue (already present) when overriding the configuration. Nested functions (such as the ones in `plugins` were lost) - Add a `Reveal in console` feature. This logs the function in the console, allowing developers to click on it to see the code in Chrome's Source tab.

Test instructions

  • Build the extension locally.
  • Visit sites which use beforeSend and/or other configurations using functions.
  • Check that you can see the code, reveal in the explorer.
  • Check that you can override the (rest of the) configuration without breaking these functions. They cannot be overridden.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@yannickadam yannickadam requested a review from a team as a code owner December 17, 2025 18:03
@yannickadam yannickadam changed the title Yannick.adam/extension handle function values in configuration [Extension] Handle function values in configuration Dec 17, 2025
parentValue: descriptor.value as unknown[],
value: child,
path: descriptor.path,
path: descriptor.path ? `${descriptor.path}.${i}` : String(i),
Copy link
Member

Choose a reason for hiding this comment

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

Issue: The omission of the index was intentional. It follows the events platform query, so you can copy a path and paste it in the Datadog ui.

defaultCollapseLevel: number
getMenuItemsForPath?: GetMenuItemsForPath
formatValue: FormatValue
sdkType?: 'rum' | 'logs'
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: it could be nice to keep the json component more or less generic, because it's used in multiple places, not only for displaying configuration. Maybe add a onRevealFunctionLocation prop and externalize that logic?

@cit-pr-commenter
Copy link

cit-pr-commenter bot commented Dec 18, 2025

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 164.34 KiB 164.34 KiB 0 B 0.00%
Rum Profiler 4.32 KiB 4.32 KiB 0 B 0.00%
Rum Recorder 20.02 KiB 20.02 KiB 0 B 0.00%
Logs 56.14 KiB 56.14 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 121.62 KiB 121.62 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0042 0.0044 +4.76%
RUM - add action 0.0121 0.0128 +5.79%
RUM - add error 0.0117 0.0126 +7.69%
RUM - add timing 0.0029 0.0026 -10.34%
RUM - start view 0.0033 0.0032 -3.03%
RUM - start/stop session replay recording 0.0007 0.0007 0.00%
Logs - log message 0.0137 0.0132 -3.65%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 26.04 KiB 26.02 KiB -26 B
RUM - add action 48.30 KiB 48.50 KiB +206 B
RUM - add timing 24.12 KiB 24.65 KiB +545 B
RUM - add error 53.90 KiB 54.41 KiB +523 B
RUM - start/stop session replay recording 23.28 KiB 25.47 KiB +2.19 KiB
RUM - start view 424.06 KiB 423.51 KiB -561 B
Logs - log message 44.77 KiB 44.26 KiB -517 B

🔗 RealWorld

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Dec 18, 2025

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

❄️ 1 New flaky test detected

action collection › associate a long tasks to its action › async from rum/actions.scenario.ts (Datadog) (Fix with Cursor)
createTest.ts:244:3 async

[chromium] › ../lib/framework/createTest.ts:244:3 › action collection › associate a long tasks to its action › async 

    Error: expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

    @@ -6,11 +6,11 @@
...

ℹ️ Info

🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 100.00%
Overall Coverage: 77.21% (-0.02%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b8ab345 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

Copy link
Contributor

@BeltranBulbarellaDD BeltranBulbarellaDD left a comment

Choose a reason for hiding this comment

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

LGTM!

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