getsentry / sentry-go

The official Go SDK for Sentry (sentry.io)
https://docs.sentry.io/platforms/go/
MIT License
901 stars 211 forks source link

Logrus hook prints error if event has been dropped #578

Open hnicke opened 1 year ago

hnicke commented 1 year ago

When using the logrus hook to send logs to sentry, the following line is printed everytime the hook is triggered but the event is dropped (e.g. by using BeforeSend):

Failed to fire hook: failed to send to sentry

The log is triggered by this particular error. I think this error should not be thrown at all since it's a valid scenario to drop sentry events client-side.

hnicke commented 1 year ago

I have figured out that the error can be suppressed by setting a fallback:

hook.SetFallback(func(entry *log.Entry) error {
    return nil
})

Given this solution the PR is not needed anymore.

cleptric commented 1 year ago

We actually need to change this 😄 As said in the PR, the HttpTransport always returns an ID, regardless if the event was actually successfully submitted over the wire.

github-actions[bot] commented 1 year ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀