Skip to content

User Feedback Feature Request: Custom context #10916

Closed
@lbernick

Description

@lbernick

Problem Statement

Use case: When an error occurs, we prompt the user for feedback and also for consent to upload diagnostic info. Diagnostic info is uploaded to cloud storage, and I'd like to associate the cloud storage URI with the event created in Sentry. This URI is only generated after the user consents to uploading diagnostics, so it's not available at the time of the crash. This is very similar to https://forum.sentry.io/t/updating-event-after-initial-upload/15057 but I didn't see a solution for that issue.

For user feedback that isn't related to a crash, we can do:

    Sentry.withScope(function (scope) {
      scope.setContext("Diagnostic Info", {
        URI: uri,
      })
      eventId = Sentry.captureMessage(`User Feedback from ${name}`)
    })
    const userFeedback = {
      event_id: eventId,
      name: name,
      email: email,
      comments: comments,
    }
    Sentry.captureUserFeedback(userFeedback)

However, for user feedback for a crash report, I don't see a way of attaching this context to the original event.

Workarounds:
I'd rather not do either of these options but I suppose they could work:

  • use "comments" field in user feedback api for jsonified context
  • create a global setting to opt in to diagnostics upload and automatically upload after a crash

Let me know if there are other options I should consider.

Alternatives:

  • Attachments for user feedback: This could work but the size of the diagnostic info is larger than Sentry's allowable attachment size.
  • Allow an event's context to be updated after creation.

Solution Brainstorm

No response

Product Area

User Feedback

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions