Skip to content

Conversation

FranAguilera
Copy link
Contributor

@FranAguilera FranAguilera marked this pull request as draft September 10, 2025 10:51
LOGGER_GUARD.with(|cell| {
if cell.try_borrow().is_ok() {
self.session_strategy.start_new_session();
self.log_session_start();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only covers the case when a new session explicitly is started via the https://docs.bitdrift.io/sdk/features.html#generating-new-session-id call, we probably want this to also include the other ways in which a session is automatically started like on process start or activity expiration?

For the session metric we already emit I did this deep into the workflow engine as it already monitors for session change, but logging from there is a bit tricky so we probably need to think a bit about how it should work https://github.com/bitdriftlabs/shared-core/blob/main/bd-workflows/src/engine.rs#L504-L535

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the heads up, I was wondering about the rest as well. I see being useful where there is no new cold launch but def want to include for all session creation cases. Will investigate and report back

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be done inside bd-session module?

@FranAguilera FranAguilera changed the title Adding session start event [WIP] Adding session start event Sep 10, 2025
@murki murki removed their request for review September 22, 2025 14:28
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

Successfully merging this pull request may close these issues.

3 participants