Skip to content

Deprecate last_event_id(). #2749

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

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/init_serverless_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Then the Handler function sstring should be replaced with
'sentry_sdk.integrations.init_serverless_sdk.sentry_lambda_handler'
"""

import os
import sys
import re
Expand Down
1 change: 1 addition & 0 deletions sentry_sdk/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def flush(
@hubmethod
def last_event_id():
# type: () -> Optional[str]

return Hub.current.last_event_id()


Expand Down
10 changes: 9 additions & 1 deletion sentry_sdk/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,15 @@ def scope(self):

def last_event_id(self):
# type: () -> Optional[str]
"""Returns the last event ID."""
"""
Returns the last event ID.

.. deprecated:: 1.40.5
This function is deprecated and will be removed in a future release. The functions `capture_event`, `capture_message`, and `capture_exception` return the event ID directly.
"""
logger.warning(
"Deprecated: last_event_id is deprecated. This will be removed in the future. The functions `capture_event`, `capture_message`, and `capture_exception` return the event ID directly."
)
return self._last_event_id

def bind_client(
Expand Down