Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sentry: log error on raven/capture! failure #59

Merged
merged 1 commit into from
Jun 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/spootnik/reporter/impl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,13 @@
(capture! this e {}))
(capture! [this e tags]
(if (:dsn sentry)
(d/chain
(raven/capture! raven-options (:dsn sentry) e tags)
(fn [event-id]
(error e (str "captured exception as sentry event: " event-id))))
(-> (raven/capture! raven-options (:dsn sentry) e tags)
(d/chain
(fn [event-id]
(error e (str "captured exception as sentry event: " event-id))))
(d/catch (fn [e']
(error e "Failed to capture exception" {:tags tags :capture-exception e'})
(capture! this e'))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, in case of an error, we are going to log the previous error e and capture the raven error failure e' – i.e. in raven, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, instead of throwing from reporter/capture! and relying on calling service error handling to capture it

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no change we'll end up on an infinite loop there?
Shall we call raven/capture! instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are calling capture! on the raven exception that we should be able to capture (and experience show we are)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arnaudgeiser I don't think we'll do b/c e' does not capture e in its context

(error e)))
RiemannSink
(send! [this ev]
Expand Down