feat(release-health): Enable session tracking by default#994
feat(release-health): Enable session tracking by default#994ahmedetefy merged 20 commits intomasterfrom
Conversation
Swatinem
left a comment
There was a problem hiding this comment.
I do have one concern, since we default to application mode, which means no pre-aggregation, currently the auto_session_tracking resource manager only checks for the auto_session_tracking flag, but not for the mode.
Why is this relevant: The wsgi integration does auto_session_tracking, so if someone has not correctly configured the SDK, that integration will generate tons of individual session updates.
|
second concern is around application mode sessions: currently there is no code that starts/stops one. what I think is missing is actually calling |
|
Do we need this flag? I thought we might be able to auto detect within the integration. Is that not the case? |
I am assuming you are talking about the auto_session_tracking flag, right? And in that case, I am not entirely sure but it seems like it relies on the options passed on init? and in regards to the session_mode that @Swatinem is referring to, afaik it is auto-detected in Rust but doesn't seem like it is in Python Am I missing something here? |
…-enable-session-tracking
…uest in WSGI handler
…entry-python into auto-enable-session-tracking
Interestingly, sentry has just hit 1.0.0! None of the nominally breaking changes[1] look relevant to our minimal usage: > - Feat: Moved auto_session_tracking experimental flag to a proper > option and removed session_mode, hence enabling release health by > default getsentry/sentry-python#994 > > - Fixed Django transaction name by setting the name to > request.path_info rather than request.path > > - Fix for tracing by getting HTTP headers from span rather than > transaction when possible getsentry/sentry-python#1035 > > - Fix for Flask transactions missing request body in non errored > transactions getsentry/sentry-python#1034 > > - Fix for honoring the X-Forwarded-For header getsentry/sentry-python#1037 > > - Fix for worker that logs data dropping of events with level error > getsentry/sentry-python#1032 [1] https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md
|
Sadly I couldn't find any documentation about what this auto session tracking actually is so I'm a bit afraid of upgrading to the latest Sentry SDK. What exactly is this feature? |
@levrik this feature tracks Release Health by sending session updates with healthy/unhealthy counts. |
|
Hello! We recently made a big upgrade from <1.0 to 1.5.7 and I believe we ran into an issue related to this—from APM, it looks like sessions were being updated frequently, which was causing some performance issues downstream, I believe due to You mentioned:
Can you clarify the misconfiguration here? Is it an incorrect Thank you! UPDATE: |
This PR adds session tracking by default, through removing
auto_session_trackingfrom experimental options to proper ones withsession_modedefaulting toapplicationbut then switches torequestin the middlewareChanges:
session_modefrom SessionFlusher (sessions.py) to Session (session.py)Hub.start_sessiontakes asession_modethat defaults toapplicationauto_session_trackingcontext manager takes an optionalsession_modeauto_session_trackingexperimental flag to a proper option that defaults toTruesession_modeexperimental option