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-6956] Add action name source #3115

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cy-moi
Copy link
Contributor

@cy-moi cy-moi commented Nov 7, 2024

Motivation

We want to add a field to indicate from which source the action names are generated.

Changes

Add a name_source field in @_dd.action object

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.17%. Comparing base (84a1fa1) to head (9fa249b).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
...core/src/domain/action/getActionNameFromElement.ts 96.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3115      +/-   ##
==========================================
- Coverage   93.63%   93.17%   -0.46%     
==========================================
  Files         276      276              
  Lines        7620     7638      +18     
  Branches     1711     1716       +5     
==========================================
- Hits         7135     7117      -18     
- Misses        485      521      +36     

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

Copy link

cit-pr-commenter bot commented Nov 7, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 161.12 KiB 161.58 KiB 473 B +0.29%
Logs 55.80 KiB 55.84 KiB 44 B +0.08%
Rum Slim 109.69 KiB 110.15 KiB 473 B +0.42%
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.005 0.002 -0.004
addaction 0.147 0.054 -0.093
addtiming 0.002 0.001 -0.001
adderror 0.147 0.048 -0.099
startstopsessionreplayrecording 3.457 1.057 -2.400
startview 2.940 1.261 -1.679
logmessage 0.057 0.028 -0.029
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 8.45 KiB 9.37 KiB 937 B
addaction 40.48 KiB 41.57 KiB 1.09 KiB
addtiming 8.73 KiB 9.61 KiB 899 B
adderror 45.10 KiB 47.22 KiB 2.12 KiB
startstopsessionreplayrecording 7.43 KiB 7.86 KiB 436 B
startview 429.04 KiB 433.80 KiB 4.76 KiB
logmessage 42.12 KiB 42.01 KiB -117 B

🔗 RealWorld

@cy-moi
Copy link
Contributor Author

cy-moi commented Nov 7, 2024

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Nov 7, 2024

🚂 Branch Integration: starting soon, median merge time is 10m

Commit d99b471eff will soon be integrated into staging-45.

Use /to-staging -c to cancel this operation!

dd-mergequeue bot added a commit that referenced this pull request Nov 7, 2024
@dd-devflow
Copy link

dd-devflow bot commented Nov 7, 2024

2024-11-07 10:28:30 UTC ℹ️ Branch Integration: This commit was successfully integrated

Commit d99b471eff has been merged into staging-45 in merge commit abd1756a7f.

Check out the triggered pipeline on Gitlab 🦊

@dd-devflow dd-devflow bot added the staging-45 label Nov 7, 2024
@dd-devflow
Copy link

dd-devflow bot commented Nov 7, 2024

2024-11-07 10:28:31 UTC ℹ️

@cy-moi
Copy link
Contributor Author

cy-moi commented Nov 12, 2024

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Nov 12, 2024

Devflow running: /to-staging

View all feedbacks in Devflow UI.


2024-11-12 13:24:38 UTC ℹ️ Branch Integration: starting soon, median merge time is 13m

Commit d99b471eff will soon be integrated into staging-46.


2024-11-12 13:34:31 UTC ℹ️ Branch Integration: This commit was successfully integrated

Commit d99b471eff has been merged into staging-46 in merge commit 2f4e24dee4.

Check out the triggered pipeline on Gitlab 🦊

dd-mergequeue bot added a commit that referenced this pull request Nov 12, 2024
@cy-moi cy-moi force-pushed the congyao/RUM-6956-add-action-name-source branch 2 times, most recently from d99b471 to 83c70f9 Compare November 13, 2024 13:07
@cy-moi cy-moi force-pushed the congyao/RUM-6956-add-action-name-source branch from 83c70f9 to ce77be2 Compare November 14, 2024 14:42
@cy-moi cy-moi marked this pull request as ready for review November 14, 2024 14:56
@cy-moi cy-moi requested a review from a team as a code owner November 14, 2024 14:56
@cy-moi cy-moi changed the title [RUM-6956] Add action name source ✨ [RUM-6956] Add action name source Nov 14, 2024

type ActionName = {
name: string
namingSource: string
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer Nov 15, 2024

Choose a reason for hiding this comment

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

💬 suggestion: ‏rename namingSource to nameSource to match the RUM event property name

💬 suggestion: ‏improve the type of the source. Maybe use a const enum for it:

const enum ActionNameSource {
  CUSTOM_ATTRIBUTE = 'custom_attribute',
  ...
}

)
if (standardName) {
return { name: standardName, namingSource: 'standard_attribute' }
Copy link
Member

Choose a reason for hiding this comment

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

💬 suggestion:priorityStrategies don't always return standard attribute values though, sometimes it is text_content. Maybe strategies can return an ActionName object, that we can use to get both the name and correct source.

(Sorry if this is what you asked confirmation for during the standup, I might have misunderstood)

Copy link
Contributor Author

@cy-moi cy-moi Nov 15, 2024

Choose a reason for hiding this comment

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

Yes, I have a local version that manually returns different sources from each strategy. But I wonder if we could also make getTextualContent return ActionName object.

Copy link
Member

Choose a reason for hiding this comment

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

Returning an ActionName object from getTextualContent sounds great. Maybe rename the function to getActionNameFromTextContent or something, it could be more explicit

name: fallbackName,
namingSource: 'text_content',
}
: { name: '', namingSource: 'blank_placeholder' }
Copy link
Member

Choose a reason for hiding this comment

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

💬 suggestion: ‏maybe just blank could be simpler than blank_placeholder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants