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

Issues & improvement proposals regarding Session Management #781

Open
surbhiia opened this issue Jan 30, 2025 · 0 comments
Open

Issues & improvement proposals regarding Session Management #781

surbhiia opened this issue Jan 30, 2025 · 0 comments

Comments

@surbhiia
Copy link
Contributor

surbhiia commented Jan 30, 2025

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 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):

Image

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:

Image

Proposals

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

No branches or pull requests

1 participant