You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SessionIdRatioBasedSampler seems to be not used in the agent at all currently (hopefully I didn't miss it).
Issues
SDK provides only one config for session timeout duration, instead there should be two, one for each foreground & background session timeout duration. Also, as a result the SDK is setting the same value (default 15 mins - set on background here, set on foreground here) in both instead of setting default 4 hours for foreground sessions.
First session is not created on application start -
-- First session will start when the first time anyone calls getSessionId(), until then we just have a default (id = "") session in place.
-- And getSessionId() is only getting called when you call SessionIdSpanAppender the first time, so new session is created only when first trace is calling the span processor, not when application starts
-- I was able to vet the same with debugging the demo-app:
Looks like when ActivityLifecycleInstrumentation is installed, it calls AppStartupTimer to emit the app start event, that's when SessionIdSpanAppender is called, which calls session.getSessionId() and leads to 1st session creation (attaching screenshot with debug stack trace for same):
Solution: We can initialize the first session in the init block of SessionManagerImpl, that way session will start as soon as the SessionManagerImpl object is created in OpenTelemetryRumBuilder (which should be called in customer's application onCreate). Below is a stack trace showing when SessionManagerImpl is first called while debugging demo app:
:services dependency is not needed in :session module - Created a quick PR for this as I already had it in working repo from my test. :)
Proposals
Move SessionManagerImpl & SessionIdTimeoutHandler inside a package called "internal" under :session module. It allows others to use the :session module as is, if they wanted to use our opinionated implementation of the SessionManager (i.e SessionManagerImpl) too.
Callouts
Issues
SDK provides only one config for session timeout duration, instead there should be two, one for each foreground & background session timeout duration. Also, as a result the SDK is setting the same value (default 15 mins - set on background here, set on foreground here) in both instead of setting default 4 hours for foreground sessions.
First session is not created on application start -
-- First session will start when the first time anyone calls getSessionId(), until then we just have a default (id = "") session in place.
-- And
getSessionId()
is only getting called when you callSessionIdSpanAppender
the first time, so new session is created only when first trace is calling the span processor, not when application starts-- I was able to vet the same with debugging the demo-app:
Looks like when
ActivityLifecycleInstrumentation
is installed, it callsAppStartupTimer
to emit the app start event, that's whenSessionIdSpanAppender
is called, which callssession.getSessionId()
and leads to 1st session creation (attaching screenshot with debug stack trace for same):Solution: We can initialize the first session in the init block of
SessionManagerImpl
, that way session will start as soon as theSessionManagerImpl
object is created inOpenTelemetryRumBuilder
(which should be called in customer's applicationonCreate
). Below is a stack trace showing whenSessionManagerImpl
is first called while debugging demo app:Proposals
SessionIdTimeoutHandler
class to include the wordbackground
as it essentially handles background session expiry.The text was updated successfully, but these errors were encountered: