Repository navigation
Closed
Description
Problem Statement
The king is dead, long live the king...
We removed lastEventId in #10585 due to several shortcomings of this API:
- It would return potentially unexpected event ids, for example when multiple errors were caught in sequence
- The last eventId was updated directly in
captureEvent, before processing and sending the event. Meaning, if users or our event processors dropped the event,lastEventIdwould return an id of an event that wasn't ever sent from the SDK. - Depending on how
Hubwas used, it could potentially bleed through requests/"leak" an event id of another request if there was no proper request isolation set up.
Solution Brainstorm
In an effort to minimize friction we should bring back this API:
- Store it on the isolation scope (--> ideally avoids cross-request bleeds on server; doesn't matter for browser)
- Update the last event id on the isolation scope directly before sending the event (i.e. when chances are low that the event is still dropped on the client side)
- Unchanged to previous implementation: only update the id with error events
- Add a big warning that this API returns potentially nonsense
### Tasks
- [ ] https://github.com/getsentry/sentry-javascript/pull/12022
- [ ] https://github.com/getsentry/sentry-javascript/pull/12029
- [ ] https://github.com/getsentry/sentry-javascript/pull/12042
- [x] Update migration docs
- [ ] https://github.com/getsentry/sentry-docs/pull/10127
Activity
Lms24 commentedon May 8, 2024
Also ref: getsentry/sentry-python#3057 (comment)
Lms24 commentedon May 13, 2024
Python PR using isolationScope: getsentry/sentry-python#3064
feat(scope): Bring back `lastEventId` on isolation scope (#11951)
feat(scope): Bring back `lastEventId` on isolation scope (#11951) (#1…
ref(api): Remove `lastEventId` deprecation warnings (#11951)
ref(api): Remove `lastEventId` deprecation warnings (#11951) (#12042)
feat(scope): Bring back `lastEventId` on isolation scope (#11951) (#1…
thespacemanatee commentedon Nov 26, 2024
@Lms24 we are not seeing this reintroduced in
8.40.0. Was it removed again? This is not documented anywhere since it was removed in getsentry/sentry-docs#10127.Lms24 commentedon Nov 26, 2024
@thespacemanatee which SDK are you using?
Sentry.lastEventId()should be availablethespacemanatee commentedon Nov 26, 2024
@Lms24 We are using https://github.com/getsentry/sentry-react-native/releases/tag/6.3.0 which depends on
@sentry/[email protected]. Hope that helps!