sentry-ruby icon indicating copy to clipboard operation
sentry-ruby copied to clipboard

Log url to errors

Open grosser opened this issue 3 years ago • 3 comments

Describe the idea show a clickable url instead of just the event id when logging an error

Why do you think it's beneficial to most of the users they don't need to be a sentry expert to find the error

Possible implementation

# make events clickable
Sentry::LoggingHelper.prepend(Module.new do
  def log_info(message)
    super(message.sub(
      /\[event\] (\S+) to Sentry/,
      "[event] https://sentry.io/organizations/<ORG>/issues/?query=\\1 to Sentry"
    ))
  end
end)

to make this reusable a project setting might be needed, or the project could be included in the sentry api reply.

grosser avatar Apr 05 '22 16:04 grosser

@sl0thentr0py Can you check if this is possible for both sentry.io and self-hosted users? I think it'd be helpful but not sure what's our stance for this.

st0012 avatar Apr 23 '22 11:04 st0012

I think it should be possible since the sentry_dsn is unique and the api could return a url to go to. If that for some reason does not work, at least a "base url" setting should always work.

grosser avatar Apr 23 '22 15:04 grosser

The canonical way right now to use the event_id is the showReportDialog functionality but I agree that this whole flow could be optimized for certain languages/frameworks.

I'll bring this up internally.

sl0thentr0py avatar Apr 25 '22 13:04 sl0thentr0py