Skip to main content

How can I give an event ID to the end-user?

Issue

I want to show my end-users an internal error reference (such as a Sentry event ID) when a runtime error occurs, so I can correlate their support tickets with events in my Sentry dashboard.

Applies To

  • All SaaS Customers and Self-Hosted Users

  • Error Monitoring

  • SDK Configuration

Resolution

Yes. When you capture an error, the SDK returns the event ID. Collect that ID and present it to your end-user. This helps you correlate Sentry events in your dashboard with user reports such as support tickets.

In every SDK, captureException (and captureMessage) returns the event ID. Many SDKs also expose lastEventId() to retrieve the ID of the most recently captured event. For example, in ASP.NET with the .NET SDK:

var eventId = SentrySdk.CaptureException(exception);
return $"Error ID: {eventId}";

For the capture methods in your SDK, see the capturing errors documentation.

Keep two things in mind:

  1. The issue ID does not exist at the time of the error. The SDK generates an event ID when the error is captured, but the issue ID is only created after Sentry's backend groups events. You cannot provide an issue ID at capture time. This is a common misconception, so give users the event ID, not the issue ID.

  2. The event might not reach Sentry. An event can be dropped by inbound filters, rate limits, or other server-side checks. Even if the SDK generates a valid event ID and the network shows a 2xx response, that event ID may not correspond to an event stored in Sentry. See Why is my event missing in Sentry even though I have an event ID?.

To collect structured feedback tied to an event ID (for example, via the User Feedback dialog), see the User Feedback documentation.

Did this answer your question?