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.

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

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.75 KiB 169.51 KiB +1.76 KiB +1.05%
Rum Profiler 4.33 KiB 4.32 KiB -1 B -0.02%
Rum Recorder 24.48 KiB 24.48 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.85 KiB 126.50 KiB +1.65 KiB +1.32%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
addglobalcontext N/A 0.0037 N/A
addaction N/A 0.0125 N/A
adderror N/A 0.0126 N/A
addtiming N/A 0.0024 N/A
startview N/A 0.0029 N/A
startstopsessionreplayrecording N/A 0.0006 N/A
logmessage N/A 0.0138 N/A
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
addglobalcontext N/A 27.69 KiB N/A
addaction N/A 58.78 KiB N/A
addtiming N/A 27.89 KiB N/A
adderror N/A 58.71 KiB N/A
startstopsessionreplayrecording N/A 26.95 KiB N/A
startview N/A 431.05 KiB N/A
logmessage N/A 48.89 KiB N/A

🔗 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: 71.43%
Overall Coverage: 77.27% (-0.07%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 668bda0 | 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".

Copy link
Contributor Author

@BeltranBulbarellaDD BeltranBulbarellaDD Jan 23, 2026

Choose a reason for hiding this comment

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

The idea would be to reuse it for different events, else it adds bloat.

Without it only for actions and resources:
Without this: Rum | 169.41 KiB
With it: Rum | 169.52 KiB

After AI refactoring quickly VitalCollection to use it I got:
rum | 169.45 KiB

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