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

Bring back lastEventId API #11951

Closed
5 tasks done
Lms24 opened this issue May 8, 2024 · 5 comments
Closed
5 tasks done

Bring back lastEventId API #11951

Lms24 opened this issue May 8, 2024 · 5 comments
Assignees

Comments

@Lms24
Copy link
Member

Lms24 commented May 8, 2024

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, lastEventId would return an id of an event that wasn't ever sent from the SDK.
  • Depending on how Hub was 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
@Lms24
Copy link
Member Author

Lms24 commented May 8, 2024

Also ref: getsentry/sentry-python#3057 (comment)

@Lms24
Copy link
Member Author

Lms24 commented May 13, 2024

Python PR using isolationScope: getsentry/sentry-python#3064

andreiborza added a commit that referenced this issue May 14, 2024
…2022)

Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
andreiborza added a commit that referenced this issue May 15, 2024
The `lastEventId` api will be brought back in v8 in the near future.
andreiborza added a commit that referenced this issue May 15, 2024
The `lastEventId` api will be brought back in v8 in the near future.
@mydea mydea closed this as completed May 15, 2024
andreiborza added a commit that referenced this issue May 16, 2024
…2022)

Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
@thespacemanatee
Copy link

@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
Copy link
Member Author

Lms24 commented Nov 26, 2024

@thespacemanatee which SDK are you using? Sentry.lastEventId() should be available

@thespacemanatee
Copy link

@Lms24 We are using https://github.com/getsentry/sentry-react-native/releases/tag/6.3.0 which depends on @sentry/core@8.40.0. Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants