Skip to content

Conversation

@BeltranBulbarellaDD
Copy link
Contributor

@BeltranBulbarellaDD BeltranBulbarellaDD commented Jan 22, 2026

Motivation

Discussed in this RFC

Following the same pattern as for start/stopAction, this PR introduces a manual resource tracking API.

Since start/stopAction and start/stopResource follow similar patterns, created eventTracker the idea is to reuse it for all events which have start/stop logic.

Changes

New Experimental Feature

  • Added START_STOP_RESOURCE feature flag

New Public APIs

  • Added startResource(url, options?) and stopResource(url, options?) to RumPublicApi

Architecture Refactoring

  • Extracted eventTracker: Shared utility for managing start/stop lifecycle (used by both actions and resources)
  • Refactored trackManualActions.ts to use the shared utility
  • Added trackManualResources.ts for manual resource lifecycle
  • Removed trackAction as it is now replaced by eventTracker

Test instructions

I used this HTML file to test locally.

Example Resource

Example in Flutter web.

Checklist

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

@cit-pr-commenter-54b7da
Copy link

cit-pr-commenter-54b7da bot commented Jan 22, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 167.98 KiB 169.86 KiB +1.89 KiB +1.12%
Rum Profiler 4.31 KiB 4.31 KiB +1 B +0.02%
Rum Recorder 24.54 KiB 24.54 KiB +1 B +0.00%
Logs 56.25 KiB 56.29 KiB +44 B +0.08%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 124.88 KiB 126.65 KiB +1.78 KiB +1.42%
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.0039 0.0046 +17.95%
RUM - add action 0.0129 0.015 +16.28%
RUM - add error 0.0133 0.0156 +17.29%
RUM - add timing 0.0026 0.0026 0.00%
RUM - start view 0.0031 0.003 -3.23%
RUM - start/stop session replay recording 0.0007 0.0006 -14.29%
Logs - log message 0.0176 0.0142 -19.32%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 28.70 KiB 26.65 KiB -2.04 KiB
RUM - add action 100.44 KiB 51.09 KiB -49.34 KiB
RUM - add timing 27.83 KiB 26.99 KiB -860 B
RUM - add error 102.86 KiB 54.92 KiB -47.94 KiB
RUM - start/stop session replay recording 26.75 KiB 26.85 KiB +109 B
RUM - start view 438.38 KiB 430.18 KiB -8.20 KiB
Logs - log message 48.20 KiB 47.75 KiB -461 B

🔗 RealWorld

@datadog-official
Copy link

datadog-official bot commented Jan 22, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 73.74%
Overall Coverage: 77.08%

View detailed report

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

@BeltranBulbarellaDD BeltranBulbarellaDD changed the title refactor manual tracking, add s/s resource ⚗ [RUM-11393] Add Start/StopResource API Jan 22, 2026
@BeltranBulbarellaDD
Copy link
Contributor Author

@codex pls review.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 998c7a9b5f

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

@BeltranBulbarellaDD
Copy link
Contributor Author

@codex pls review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 69aa0b9ef0

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

@BeltranBulbarellaDD
Copy link
Contributor Author

@codex can you pls review?

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 1d19e7c3ea

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

…iscard. Switched to makeRumPublicApiWithDefaults which has built-in cleanup in startResource / stopResource
@BeltranBulbarellaDD
Copy link
Contributor Author

@codex pls review now?

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 83054aa544

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

@BeltranBulbarellaDD
Copy link
Contributor Author

@codex pls review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: c6ec7ebdfb

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

@BeltranBulbarellaDD
Copy link
Contributor Author

@codex pls review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 7d07e62855

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

@BeltranBulbarellaDD
Copy link
Contributor Author

@codex pls review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 9294b1d657

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

@BeltranBulbarellaDD BeltranBulbarellaDD marked this pull request as ready for review February 2, 2026 14:01
@BeltranBulbarellaDD BeltranBulbarellaDD requested a review from a team as a code owner February 2, 2026 14:01
}

function startManualResource(url: string, options: ResourceOptions = {}, startClocks = clocksNow()) {
if (!isAllowedRequestUrl(url)) {
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: this is probably unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it because of this Codex Review.

@BeltranBulbarellaDD
Copy link
Contributor Author

@codex pls review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: d8ef180bf1

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

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