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

feat: Capture Nearest UserAction Fields #1267

Merged
merged 6 commits into from
Feb 4, 2025
Merged

Conversation

metal-messiah
Copy link
Member

@metal-messiah metal-messiah commented Dec 2, 2024

The UserAction feature has been extended to capture "nearest" field values when the UserAction target does not include the desired fields. To facilitate this, a configuration was added allowing the user to control what fields are collected, specified as init.user_actions.elementAttributes: []. When empty, no extra fields will be collected. When supplied, the target will be checked for each property. This configuration defaults to ['id', 'className', 'tagName', 'type'], which matches the fields captured before this change.

For each elementAttribute defined, if the property is not found, the agent will search up the parent tree of the target element, until the property is found. If found up the parent tree, a property called "nearest" + fieldName will be added to the event.

Overview

This was spawned from feedback and POC tied to internal NR1 use cases and product analytics. Exposing to customer base to benefit all.

Related Issue(s)

NR-359755

Testing

Test has been added

@metal-messiah metal-messiah added the POC A proof of concept label Dec 2, 2024
@metal-messiah metal-messiah changed the title feat: customize user actions attributes for internap product analytics feat: customize user actions attributes for internal product analytics Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

Asset Size Report

Merging this pull request will result in the following asset size changes:

Agent Asset Previous Size New Size Diff
lite loader 29.75 kB / 10.79 kB (gzip) 29.81 kB / 10.81 kB (gzip) 0.18% / 0.24% (gzip)
lite async-chunk 52.31 kB / 16.97 kB (gzip) 52.31 kB / 16.97 kB (gzip) 0% / 0% (gzip)
pro loader 51.4 kB / 17.74 kB (gzip) 51.45 kB / 17.76 kB (gzip) 0.11% / 0.14% (gzip)
pro async-chunk 99.14 kB / 30.24 kB (gzip) 99.72 kB / 30.45 kB (gzip) 0.59% / 0.68% (gzip)
spa loader 59.02 kB / 20.07 kB (gzip) 59.07 kB / 20.1 kB (gzip) 0.09% / 0.14% (gzip)
spa async-chunk 113.85 kB / 34.58 kB (gzip) 114.43 kB / 34.77 kB (gzip) 0.51% / 0.57% (gzip)

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.36%. Comparing base (86943eb) to head (0eb859f).
Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1267      +/-   ##
==========================================
+ Coverage   88.67%   90.36%   +1.68%     
==========================================
  Files         170      171       +1     
  Lines        7314     8202     +888     
  Branches     1478     1480       +2     
==========================================
+ Hits         6486     7412     +926     
+ Misses        714      698      -16     
+ Partials      114       92      -22     
Flag Coverage Δ
integration-tests 91.97% <100.00%> (+0.77%) ⬆️
unit-tests 79.97% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@metal-messiah metal-messiah changed the title feat: customize user actions attributes for internal product analytics feat: Allow Fields Specification and Capture Nearest Fields Jan 17, 2025
Copy link

github-actions bot commented Jan 17, 2025

Static Badge

Last ran on January 29, 2025 14:14:22 CST
Checking merge of (0eb859f) into main (86943eb)

@metal-messiah metal-messiah marked this pull request as ready for review January 17, 2025 16:30
@ellisong ellisong self-requested a review January 29, 2025 18:28
Copy link
Contributor

@ellisong ellisong left a comment

Choose a reason for hiding this comment

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

LGTM

@metal-messiah metal-messiah changed the title feat: Allow Fields Specification and Capture Nearest Fields feat: Capture Nearest UserAction Fields Feb 4, 2025
@metal-messiah metal-messiah merged commit d410937 into main Feb 4, 2025
55 checks passed
@metal-messiah metal-messiah deleted the user-action-custom-props branch February 4, 2025 16:04
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