-
Notifications
You must be signed in to change notification settings - Fork 140
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
⚗[RUMF-878] add trackViewsManually option (disabled) #867
Conversation
Codecov Report
@@ Coverage Diff @@
## main #867 +/- ##
==========================================
+ Coverage 88.78% 89.12% +0.33%
==========================================
Files 81 81
Lines 3762 3787 +25
Branches 836 845 +9
==========================================
+ Hits 3340 3375 +35
+ Misses 422 412 -10
Continue to review full report at Codecov.
|
c9aec32
to
750eb2b
Compare
packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts
Outdated
Show resolved
Hide resolved
lifeCycle.subscribe(LifeCycleEventType.SESSION_RENEWED, () => { | ||
// do not trigger view update to avoid wrong data | ||
currentView.end() | ||
if (areViewsTrackedAutomatically) { | ||
// Renew view on session renewal | ||
currentView = trackViewChange() | ||
} | ||
}) |
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.
Has it be discussed somewhere? Since the user can't know when the session is renewed, they won't be able to create a new view in this case.
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.
Has it be discussed somewhere?
No!
IMO, it seems more aligned with the manual tracking strategy to not take the responsibility to start a new view in this case. It can also be deceptive to have view without name in this case and I am not sure that we can make the assumption that we can reuse the previous view name 😕
We could expose something like DD_RUM.onSessionRestart(callback)
API to allow customer to deal with these cases.
wdyt?
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.
Ok it makes sense to avoid making assumption on the new view name. I would prefer to avoid adding new APIs if possible. Maybe ensuring that the session is renewed when using DD_RUM.startView()
could be enough?
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.
looks like a good plan to me, I'd be in favor of adding this behavior in an a following PR though.
c0c9cf4
to
b66ed1b
Compare
Hi! So I guess I could trigger Do you have any idea when you will be ready with that feature? |
Hi @degregar, This is a work in progress but we hope to have something usable publicly in the coming weeks. |
8b4c441
to
d6d2ba7
Compare
d6d2ba7
to
e1f1ff0
Compare
- introduce `trackViewsManually` configuration - on manual mode, wait for the first startView to start RUM - keep processing beforeInitCalls for potential startView but execute calls at start - ensure that recording start after RUM start
775fa44
to
a633a0b
Compare
packages/rum-core/src/domain/rumEventsCollection/view/trackViews.ts
Outdated
Show resolved
Hide resolved
4f8a608
to
0cefb10
Compare
on manual mode: - do not create new view on location - do not track new view on session renewed - keep updating view location on location changes
0cefb10
to
9daeb53
Compare
- introduce viewTest helper to easily check view behaviors consistently - test behaviors for auto/manual mode - move location changes test to trackView.spec to be more symetric between auto and manual tests
9daeb53
to
a4bb9ae
Compare
packages/rum-core/src/domain/rumEventsCollection/view/trackViewMetrics.spec.ts
Outdated
Show resolved
Hide resolved
2fcf57f
to
2b79460
Compare
Motivation
Following #850, another step for the manual view naming strategy, allowing to disable the automatic tracking of views on location change.
Changes
trackViewsManually
configuration (behindview-renaming
flag)trackViewsManually
is enabled:startView
callboot/[package].ts
toboot/start[Package].ts
Testing
unit, e2e, manual
I have gone over the contributing documentation.