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

Session Id Refresh Callback #328

Open
Archish27 opened this issue Apr 29, 2024 · 4 comments
Open

Session Id Refresh Callback #328

Archish27 opened this issue Apr 29, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@Archish27
Copy link
Contributor

When session expires we need a callback or hook to identify that the session has ended based on that we can do clean up of cached session id. Or trigger any custom logic as when required if callback implemented.

@breedx-splk
Copy link
Contributor

Hey @Archish27. This seems like a perfectly reasonable request to me...but can you be a little more specific about what you're trying to do when notified of a session change? There is code already in place to listen for a session id expiration and generate a notification "event" that contains the new session id and the previous session id.

If you're caching the session ID elsewhere in your app or in your custom telemetry, then this will be a larger problem for you. You should always be calling OpenTelemetryRum.getRumSessionId() any time you need to reference the session ID.

@Archish27
Copy link
Contributor Author

Hey @Archish27. This seems like a perfectly reasonable request to me...but can you be a little more specific about what you're trying to do when notified of a session change? There is code already in place to listen for a session id expiration and generate a notification "event" that contains the new session id and the previous session id.

If you're caching the session ID elsewhere in your app or in your custom telemetry, then this will be a larger problem for you. You should always be calling OpenTelemetryRum.getRumSessionId() any time you need to reference the session ID.

Use case is we do screen recording so let say if session.id is changed we need to stop recording. The other use case there are some application threads running so, in a way need a callback to cleanup resources on change session event.

@breedx-splk breedx-splk added the enhancement New feature or request label Jun 10, 2024
@MdNaushad
Copy link

@Archish27 , @breedx-splk Is there any update on this? Anyone picked this up yet?

@breedx-splk
Copy link
Contributor

Hey @MdNaushad. We do have the SessionObserver class in place, managed by the SessionManager that implements SessionPublisher. However, there's not currently any easy way for users to get access to the SessionManager or to add observers as part of the agent/sdk setup.

Are you interested in picking this up?

We're actively working on trying to pin down the shape of our public API, especially with regard to how users set up and configure the OpenTelemetryRum instance (via builder currently). This would need to be a consideration in that API surface for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants