-
Notifications
You must be signed in to change notification settings - Fork 0
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
[DTA-1034] Integrate BugSnag error monitoring in the Payment Service #6
[DTA-1034] Integrate BugSnag error monitoring in the Payment Service #6
Conversation
src/paymentservice/charge.js
Outdated
|
||
module.exports.charge = async request => { | ||
const span = tracer.startSpan('charge'); | ||
|
||
await OpenFeature.setProviderAndWait(flagProvider); | ||
if (await OpenFeature.getClient().getBooleanValue("paymentServiceFailure", false)) { | ||
Bugsnag.notify(new Error("PaymentService Fail Feature Flag Enabled")); |
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.
Bugsnag by default should report unhandled errors. If you remove this line, does it still send an error?
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.
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.
LGTM
A note, that before merging and deploying it, we need to add the PAYMENT_SERVICE_BUGSNAG_API_KEY
to GitHub secrets.
docker-compose.yml
Outdated
@@ -439,6 +439,7 @@ services: | |||
- "${PAYMENT_SERVICE_PORT}" | |||
environment: | |||
- PAYMENT_SERVICE_PORT | |||
- PAYMENT_SERVICE_BUGSNAG_API_KEY |
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.
Based on how the Terraform configuration looks, it seems that we need to keep the BUGSNAG_API_KEY
in the app and add the mapping in here, so what should work is:
- BUGSNAG_API_KEY=${PAYMENT_SERVICE_BUGSNAG_API_KEY}
So in the .env
file we will have PAYMENT_SERVICE_BUGSNAG_API_KEY
and in the code in the app BUGSNAG_API_KEY
.
Please let me know if it works.
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.
I made the change and it works, I could still see the error in Bugnsag
Changes
Installed Bugnsag Error Monitoring into the payment service.
DTA-1034