-
Notifications
You must be signed in to change notification settings - Fork 91
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
remonte les erreurs dans Sentry lorsqu'un appel webhook est en erreur #9573
Conversation
app/jobs/web_hook_job.rb
Outdated
procedure = Procedure.find(procedure_id) | ||
Typhoeus.post(procedure.web_hook_url, body: body, timeout: TIMEOUT) | ||
|
||
Sentry.configure_scope do |scope| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu n'as pas besoin de faire Sentry.configure_scope
. Les jobs sont enveloppés dans un scope isolé par défaut. Donc tu peux faire directement Sentry.set_tags(dossier: dossier_id, procedure: procedure_id)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, merci pour l'info :) Pour ma curiosité, je vois bien un Sentry.configure_scope
dans ApplicationController
mais je ne vois pas d'équivalent côté jobs. Le scope isolé par défaut par les jobs est setté où ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai amendé le commit pour intégrer ta suggestion : c3dfd73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai amendé le commit pour intégrer ta suggestion : c3dfd73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c'est fait par la gem sentry
21df9f3
to
c3dfd73
Compare
app/jobs/web_hook_job.rb
Outdated
|
||
response = Typhoeus.post(procedure.web_hook_url, body: body, timeout: TIMEOUT) | ||
|
||
raise StandardError, response if !response.success? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ça va faire des retry en pagaille, non ? C'est ce que tu veux ? Pour moi c'est un breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ce n'est pas forcément ce que je veux. Ce que je souhaite, c'est avoir une trace quand la réponse du webhook n'est pas un succès.
J'ai amendé le commit en ne levant pas d'exception, mais en appelant Sentry.capture_message
pour remonter l'info dans Sentry
c3dfd73
to
72d28fd
Compare
72d28fd
to
3fdc3a1
Compare
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
No description provided.