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

Logrus hook prints error if event has been dropped

Open hnicke opened this issue 3 years ago • 3 comments

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 avatar Feb 10 '23 13:02 hnicke

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.

hnicke avatar Feb 15 '23 13:02 hnicke

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.

cleptric avatar Feb 15 '23 13:02 cleptric

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 🥀

github-actions[bot] avatar Mar 09 '23 00:03 github-actions[bot]