Skip to content

feat: Support pre-aggregated sessions - #985

Merged
Swatinem merged 6 commits into
masterfrom
feature/session-stuff
Feb 3, 2021
Merged

Swatinem merged 6 commits into
masterfrom
feature/session-stuff

Conversation

@Swatinem

Copy link
Copy Markdown
Contributor

This changes the SessionFlusher to pre-aggregate sessions according to https://develop.sentry.dev/sdk/sessions/#session-aggregates-payload instead of sending individual session updates.

The current implementation will always aggregate sessions, as the SDK currently lacks the possibility to chose between application-mode or request-mode sessions.

@Swatinem
Swatinem marked this pull request as ready for review January 28, 2021 11:17
@Swatinem
Swatinem requested a review from mitsuhiko February 3, 2021 11:53
@mitsuhiko

Copy link
Copy Markdown
Contributor

Looking good

@Swatinem
Swatinem merged commit 7ba60bd into master Feb 3, 2021
@Swatinem
Swatinem deleted the feature/session-stuff branch February 3, 2021 20:44
sentrivana added a commit that referenced this pull request Oct 29, 2026
### Description

Removes the module-level `TERMINAL_SESSION_STATES` tuple from
`sentry_sdk/sessions.py`. It has never been read anywhere.

#627 (Mar 2020) added it with the original session tracking code, and
#985 (Feb 2021) moved it a few lines down. Neither change, nor any other
commit, added a use of it. Session status handling (`Session.close()`,
`SessionFlusher` aggregation) compares against the status literals
directly.

**Evidence**
- `git grep TERMINAL_SESSION_STATES` across the whole repo matches only
the definition.
- `git log -G TERMINAL_SESSION_STATES` shows only #627 (added) and #985
(moved).
- No open PR or issue mentions it.

**Why it's safe**
- It's a plain constant in an internal module. It's not re-exported from
`sentry_sdk` and doesn't appear in `docs/`, `CHANGELOG.md` or
`MIGRATION_GUIDE.md`.
- It was never read at runtime, so behavior doesn't change.

#### Issues
n/a

<!-- junior-request-attribution:start -->
via **Ivana Kellyer**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0BTREZTS2Z%3A1793270559.842119 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
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.

2 participants