Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ [RUM-8123] Introduce a hook to assemble events #3289

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

amortemousque
Copy link
Collaborator

Motivation

The overall goal is to create a Modular SDK to simplify contributions and enhance extensibility.

This PR introduces a hook system, initially used to decouple event assembly. Each collection module can now independently handle the assembly of its own properties.

Changes

  • Introduce a Hooks system
  • Utilize the Assemble hook in viewCollection to manage the assembly of view properties

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@amortemousque amortemousque requested a review from a team as a code owner January 16, 2025 19:47
const commonContext = savedCommonContext || getCommonContext()
const actionId = actionContexts.findActionId(startTime)

const rumContext: RumContext = {
const rumContext: Partial<CommonProperties> = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change unrelated to the PR, but we can remove RumContext and directly use the CommonProperties type generated by the rum-event-format

@amortemousque amortemousque marked this pull request as draft January 16, 2025 19:53
@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.71%. Comparing base (9fbe626) to head (1893d43).

Files with missing lines Patch % Lines
packages/rum-core/src/hooks.ts 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3289      +/-   ##
==========================================
+ Coverage   93.68%   93.71%   +0.02%     
==========================================
  Files         288      289       +1     
  Lines        7617     7633      +16     
  Branches     1739     1740       +1     
==========================================
+ Hits         7136     7153      +17     
+ Misses        481      480       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 145.66 KiB 145.93 KiB 280 B +0.19%
Logs 51.09 KiB 51.09 KiB 0 B 0.00%
Rum Slim 104.45 KiB 104.71 KiB 258 B +0.24%
Worker 24.50 KiB 24.50 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.002 0.002 0.000
addaction 0.035 0.040 0.005
addtiming 0.001 0.001 0.000
adderror 0.044 0.053 0.009
startstopsessionreplayrecording 0.007 0.011 0.004
startview 0.462 0.491 0.029
logmessage 0.020 0.020 0.000
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 27.57 KiB 27.40 KiB -172 B
addaction 56.55 KiB 55.80 KiB -762 B
addtiming 25.51 KiB 25.00 KiB -530 B
adderror 59.36 KiB 58.38 KiB -998 B
startstopsessionreplayrecording 26.77 KiB 25.28 KiB -1522 B
startview 416.06 KiB 419.60 KiB 3.54 KiB
logmessage 63.47 KiB 60.83 KiB -2704 B

🔗 RealWorld

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