Skip to content

Shadow: [RUM-15273] 🔊 Add telemetry for trackResourceHeaders (v4)#101

Open
allspain wants to merge 4 commits into
shadow/4492/v4-basefrom
shadow/4492/v4
Open

Shadow: [RUM-15273] 🔊 Add telemetry for trackResourceHeaders (v4)#101
allspain wants to merge 4 commits into
shadow/4492/v4-basefrom
shadow/4492/v4

Conversation

@allspain
Copy link
Copy Markdown
Owner

Shadow Review — PR #4492 v4

Source: DataDog/browser-sdk#4492
Commit: f6d1dfd0c9b8a92433742ff6610f240cce470e8d
Timestamp: 2026-04-21T08:20:54Z


Original PR Description

Motivation

We want to track how customers configure trackResourceHeaders (default preset vs custom array) to understand adoption patterns. This adds a use_track_resource_headers field to the telemetry configuration event.

Changes

  • Bump rum-events-format submodule for the new use_track_resource_headers telemetry configuration schema field
  • Regenerate telemetry event types
  • Add getTrackResourceHeadersTelemetryValue helper that maps the init configuration value:
    • trackResourceHeaders: true"default_headers"
    • trackResourceHeaders: [...] (array) → "custom"
    • undefined / false → omitted from the telemetry event
  • Wire the helper into serializeRumConfiguration

Test instructions

  1. Start the dev server:
yarn dev-server start
  1. Create sandbox/test-track-resource-headers-telemetry.html:
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Test trackResourceHeaders telemetry</title>
    <script src="/datadog-rum.js"></script>
    <script>
      DD_RUM.init({
        clientToken: 'xxx',
        applicationId: 'xxx',
        proxy: '/proxy',
        trackResourceHeaders: true,
      })
    </script>
  </head>
  <body>
    <p>trackResourceHeaders: true</p>
  </body>
</html>
  1. Open the page and flush events:
yarn dev-server intake clear
agent-browser open http://localhost:8081/test-track-resource-headers-telemetry.html
agent-browser tab new
  1. Verify the telemetry configuration event contains use_track_resource_headers: "default_headers":
yarn dev-server intake telemetry-configuration-events --format json | jq '.[0].telemetry.configuration.use_track_resource_headers'
# Expected: "default_headers"
  1. To test the custom case, change the init config to trackResourceHeaders: [{ name: 'x-custom' }], close the browser, clear intake, and repeat steps 3-4. Expected value: "custom".

  2. Clean up:

yarn dev-server stop
rm sandbox/test-track-resource-headers-telemetry.html

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

bdibon added 4 commits April 20, 2026 13:19
- Bump rum-events-format submodule for telemetry configuration schema
- Regenerate telemetry and RUM event types
- Map trackResourceHeaders init value to default_headers or custom for telemetry
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