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-5775] Make view local context writable #2939

Merged
merged 12 commits into from
Sep 2, 2024

Conversation

cy-moi
Copy link
Contributor

@cy-moi cy-moi commented Aug 14, 2024

Motivation

Enable users to set the view specific context with existing apis:

  • startView({...options, context})
  • beforeSend: (e) => {}

Changes

  • Add customer context in view collection
  • Add USER_CUSTOMIZABLE_FIELD_PATHS for view in event assembly
  • Add feature flag view_specific_context

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

Copy link

cit-pr-commenter bot commented Aug 14, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 160.16 KiB 160.44 KiB 296 B +0.18%
Logs 55.98 KiB 56.02 KiB 48 B +0.08%
Rum Slim 108.76 KiB 109.05 KiB 296 B +0.27%
Worker 25.21 KiB 25.21 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.042 0.036 -0.005
addtiming 0.001 0.001 0.000
adderror 0.047 0.048 0.001
startstopsessionreplayrecording 1.316 1.133 -0.184
startview 1.422 1.198 -0.224
logmessage 0.025 0.023 -0.002
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 20.23 KiB 21.23 KiB 1022 B
addaction 69.70 KiB 70.70 KiB 1.00 KiB
addtiming 15.81 KiB 20.11 KiB 4.30 KiB
adderror 82.47 KiB 86.39 KiB 3.92 KiB
startstopsessionreplayrecording 12.77 KiB 11.79 KiB -1009 B
startview 347.02 KiB 350.86 KiB 3.84 KiB
logmessage 68.87 KiB 70.99 KiB 2.12 KiB

🔗 RealWorld

@codecov-commenter
Copy link

codecov-commenter commented Aug 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.48%. Comparing base (6b3cfef) to head (70826ae).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2939      +/-   ##
==========================================
- Coverage   93.48%   93.48%   -0.01%     
==========================================
  Files         271      271              
  Lines        7616     7623       +7     
  Branches     1696     1700       +4     
==========================================
+ Hits         7120     7126       +6     
- Misses        496      497       +1     

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

@cy-moi cy-moi marked this pull request as ready for review August 19, 2024 13:58
@cy-moi cy-moi requested a review from a team as a code owner August 19, 2024 13:58
@cy-moi cy-moi marked this pull request as draft August 19, 2024 14:02
@cy-moi cy-moi marked this pull request as ready for review August 20, 2024 12:17
@cy-moi cy-moi force-pushed the congyao/RUM-5775-make-view-context-writable branch from 1b42769 to 988dc95 Compare August 21, 2024 08:37
@cy-moi cy-moi requested a review from amortemousque August 23, 2024 09:51
@cy-moi cy-moi force-pushed the congyao/RUM-5775-make-view-context-writable branch from 945ea4c to 2935eee Compare August 28, 2024 09:47
@@ -45,6 +46,7 @@ export function startViewContexts(lifeCycle: LifeCycle): ViewContexts {
return {
service: view.service,
version: view.version,
customerContext: view.context,
Copy link
Member

Choose a reason for hiding this comment

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

💬 suggestion: ‏‏I'm not a big fan of the customer prefix here. Other properties of this interface also come from the customer, so it feels weird to specify customer for context.

I understand you are using customerContext instead of context to avoid having a context field on an interface that is already called xxxContext? I agree that's too many context! But I would rather rename ViewContext to something like ViewHistoryEntry (as I suggested in the RFC) instead of using customerContext.

Copy link
Contributor Author

@cy-moi cy-moi Aug 28, 2024

Choose a reason for hiding this comment

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

I'm moving this renaming to another PR. Still in draft: #2953

@cy-moi cy-moi force-pushed the congyao/RUM-5775-make-view-context-writable branch from 2f97af7 to 840a1e7 Compare August 28, 2024 12:12
@cy-moi cy-moi force-pushed the congyao/RUM-5775-make-view-context-writable branch from 840a1e7 to 70826ae Compare August 28, 2024 16:10
@cy-moi cy-moi merged commit ca23b46 into main Sep 2, 2024
20 checks passed
@cy-moi cy-moi deleted the congyao/RUM-5775-make-view-context-writable branch September 2, 2024 15:07
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.

5 participants