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

No more last_event_id #3049

Closed
maltalk opened this issue May 6, 2024 · 5 comments · Fixed by #3064
Closed

No more last_event_id #3049

maltalk opened this issue May 6, 2024 · 5 comments · Fixed by #3064
Assignees

Comments

@maltalk
Copy link

maltalk commented May 6, 2024

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.1.0

Steps to Reproduce

https://develop.sentry.dev/sdk/features/#retrieve-last-event-id
The method last_event_id does not exist anymore. I understand that's been deprecated but, how are we supposed to show the event_id to the user now?
from sentry_sdk import last_event_id

Expected Result

Be able to get the last event id from a non controlled exception and show it to the final user.
In django for example, the recommended way was this:

from sentry_sdk import last_event_id

from django.shortcuts import render


def custom_handler500(request):
    context = {
        "request": request,
        "title": "Error 500",
        "last_event_id": last_event_id(),
    }
    template_name = "500.html"
    return render(request, template_name, context, status=500)

Actual Result

ImportError: cannot import name 'last_event_id' from 'sentry_sdk' (/app/.venv/lib/python3.11/site-packages/sentry_sdk/__init__.py)

@szokeasaurusrex
Copy link
Member

Hi @maltalk, thank you for reporting this feedback. We plan to re-add this functionality to the SDK, although we might rename the function

@maltalk
Copy link
Author

maltalk commented May 7, 2024

Thanks @szokeasaurusrex for your quick response.
Could you give me a date estimate?
Right now we are frozen on version 1.45 for this reason.

I'm not trying to rush anything at all. We understand that after the total refactor of the SDK it is not something that can be done overnight.

@szokeasaurusrex
Copy link
Member

No estimate yet @maltalk – however, since we need the last_event_id functionality for the user feedback dialog, we will likely prioritize adding this back

@szokeasaurusrex szokeasaurusrex self-assigned this May 7, 2024
szokeasaurusrex added a commit that referenced this issue May 8, 2024
szokeasaurusrex added a commit that referenced this issue May 8, 2024
szokeasaurusrex added a commit that referenced this issue May 10, 2024
szokeasaurusrex added a commit that referenced this issue May 10, 2024
szokeasaurusrex added a commit that referenced this issue May 15, 2024
szokeasaurusrex added a commit that referenced this issue May 15, 2024
@maltalk
Copy link
Author

maltalk commented May 16, 2024

That's nice. Thank you for your work. When will version 2.2.0 be available?

@szokeasaurusrex
Copy link
Member

@maltalk it is done already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
2 participants