-
Notifications
You must be signed in to change notification settings - Fork 166
⚗ [RUM-11393] Add Start/StopAction API #4038
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
Open
BeltranBulbarellaDD
wants to merge
47
commits into
main
Choose a base branch
from
beltran.bulbarella/start-stopAction
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
2f11566
add s/s action
BeltranBulbarellaDD 065a6fe
Add unit tests for startAction and stopAction
BeltranBulbarellaDD aec81c6
Linting fixes
BeltranBulbarellaDD 270c0cb
cleanup
BeltranBulbarellaDD b0bc642
fix leaked listener
BeltranBulbarellaDD a06410a
Integrated trackEventCounts and integrate with startActionCollection.
BeltranBulbarellaDD 2080477
Merge branch 'main' into beltran.bulbarella/start-stopAction
BeltranBulbarellaDD b4af4f6
merged rum-events-format
BeltranBulbarellaDD 3e88bd7
Fix format
BeltranBulbarellaDD f129855
sync schemas
BeltranBulbarellaDD 2259509
fix comma
BeltranBulbarellaDD 446390e
Add telemetry type (remove after merge in R-E-F)
BeltranBulbarellaDD efe5ffc
Add loading_time to custom actions
BeltranBulbarellaDD 2c95977
wait for fetch to complete in e2e test so to avoid flaky test
BeltranBulbarellaDD 546fdde
revert test
BeltranBulbarellaDD d7a7e14
wait for requests to complete in e2e test so to avoid flaky test
BeltranBulbarellaDD e8725ba
Update activeCustomActions to track existing actions
BeltranBulbarellaDD 9864c12
Clean up activeCustomActions on session renewal
BeltranBulbarellaDD a19c4d0
Stop active actions on session renewal, and reset the action context.
BeltranBulbarellaDD 5b40d1e
Clean up active custom actions on stop()
BeltranBulbarellaDD b513153
Create trackAction to reuse in actionCollection and trackClickActions.
BeltranBulbarellaDD f13b695
Fix linter
BeltranBulbarellaDD 969a859
Fix eslint config and linter
BeltranBulbarellaDD f8c506e
Prevent collision in getActionLookupKey
BeltranBulbarellaDD c3ddeeb
Remove unneded test, update getActionLookupKey test
BeltranBulbarellaDD e1f4512
Remove telemetry events
BeltranBulbarellaDD fda20bb
remove space
BeltranBulbarellaDD 80850cf
Return an array of action IDs in findActionId
BeltranBulbarellaDD 573cb0a
Merge branch 'main' into beltran.bulbarella/start-stopAction
BeltranBulbarellaDD ee43b93
run format
BeltranBulbarellaDD 7946916
support start time for pre init action tracking
BeltranBulbarellaDD 4227e82
Merge branch 'main' into beltran.bulbarella/start-stopAction
BeltranBulbarellaDD 1b690e5
modify to test that the clocks are captured at call time
BeltranBulbarellaDD 3e0bbd9
Remove actionKey, make experimental docs, pass clocks to actionCollec…
BeltranBulbarellaDD 40e8331
Created trackCustomActions, revamp processAction, edit clickAction.
BeltranBulbarellaDD 8e6763f
remove actionKey, run formatter.
BeltranBulbarellaDD feead72
Linting fixes
BeltranBulbarellaDD d6a11c0
Linting fixes.
BeltranBulbarellaDD 02fa207
Re add actionKey, created TrackedActionMetadata.
BeltranBulbarellaDD c28599f
Fix typecheck
BeltranBulbarellaDD 20019e3
Change getActionLookupKey
BeltranBulbarellaDD 0dc0e6a
TEST REDUCE BUNDLE SIZE
BeltranBulbarellaDD 53b70d9
SECOND TEST REDUCE BUNDLE SIZE
BeltranBulbarellaDD 66ce586
Add back action types
BeltranBulbarellaDD c0a3fd5
Fix const names, removed InstantCustomAction, remove TrackedActionMet…
BeltranBulbarellaDD 06d7565
Linter
BeltranBulbarellaDD d299a36
Merge branch 'main' into beltran.bulbarella/start-stopAction
BeltranBulbarellaDD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,7 @@ import { callPluginsMethod } from '../domain/plugins' | |
| import type { Hooks } from '../domain/hooks' | ||
| import type { SdkName } from '../domain/contexts/defaultContext' | ||
| import type { LongTaskContexts } from '../domain/longTask/longTaskCollection' | ||
| import type { ActionOptions } from '../domain/action/trackCustomActions' | ||
| import { createPreStartStrategy } from './preStartRum' | ||
| import type { StartRum, StartRumResult } from './startRum' | ||
|
|
||
|
|
@@ -168,6 +169,24 @@ export interface RumPublicApi extends PublicApi { | |
| */ | ||
| addAction: (name: string, context?: object) => void | ||
|
|
||
| /** | ||
| * [Experimental] start a custom action, stored in `@action` | ||
| * | ||
| * @category Data Collection | ||
| * @param name - Name of the action | ||
| * @param options - Options of the action | ||
| */ | ||
| startAction: (name: string, options?: ActionOptions) => void | ||
|
|
||
| /** | ||
| * [Experimental] stop a custom action, stored in `@action` | ||
| * | ||
| * @category Data Collection | ||
| * @param name - Name of the action | ||
| * @param options - Options of the action | ||
| */ | ||
| stopAction: (name: string, options?: ActionOptions) => void | ||
|
|
||
| /** | ||
| * Add a custom error, stored in `@error`. | ||
| * | ||
|
|
@@ -523,6 +542,8 @@ export interface Strategy { | |
| accountContext: ContextManager | ||
|
|
||
| addAction: StartRumResult['addAction'] | ||
| startAction: StartRumResult['startAction'] | ||
| stopAction: StartRumResult['stopAction'] | ||
| addError: StartRumResult['addError'] | ||
| addFeatureFlagEvaluation: StartRumResult['addFeatureFlagEvaluation'] | ||
| startDurationVital: StartRumResult['startDurationVital'] | ||
|
|
@@ -653,6 +674,24 @@ export function makeRumPublicApi( | |
| }) | ||
| }, | ||
|
|
||
| startAction: monitor((name, options) => { | ||
| // addTelemetryUsage({ feature: 'start-action' }) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be removed when DataDog/rum-events-format#335 |
||
| strategy.startAction(sanitize(name)!, { | ||
| type: sanitize(options && options.type) as ActionType | undefined, | ||
| context: sanitize(options && options.context) as Context, | ||
| actionKey: options && options.actionKey, | ||
| }) | ||
| }), | ||
|
|
||
| stopAction: monitor((name, options) => { | ||
| // addTelemetryUsage({ feature: 'stop-action' }) | ||
| strategy.stopAction(sanitize(name)!, { | ||
| type: sanitize(options && options.type) as ActionType | undefined, | ||
| context: sanitize(options && options.context) as Context, | ||
| actionKey: options && options.actionKey, | ||
| }) | ||
| }), | ||
|
|
||
| addError: (error, context) => { | ||
| const handlingStack = createHandlingStack('error') | ||
| callMonitored(() => { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because the command
yarn lintwas linting also playwright files.