Brief Guide on Sentry Integration with Java-Service
- Ensure you are registered to sentry
- Get DSN key for your services(applicable to manager role)
- Once you are already logged in, create new project for your domain/ services https://sentry.io/organizations/pt-trinusa-travelindo/projects/new/
- Put your domain/ service name inside:
Give your project a name:
- Use #accom as the default team
- Once you press submit/ next, watch out this message:
Already have things setup? Get your DSN.
Click the Get your DSN
- Copy down the DSN not Public DSN
- Integrate with Top Level Component
- Determine how you are going to use Sentry. Let say you prefer by domain/ service name
x
for example core
. Then, put down the sentry DSN
you got before and x
service into config file accomSentry.config
.
- Add
x
category enum inside the AccomLog4jUtil.Category .
This enum will be used for reading DSN key from the config file
- Sentry works as nice as an appender to log4j. Because of that, there is no extra code needed to send exception to sentry. In order to integrate to log4j use this
AccomLog4jUtil.initializeLog4j(env, group, node, AccomLog4jUtil.Category.CORE);
on your topLevelComponent
- Release to production
- Open up the new project created on 2nd step. Watch out if there are any exception streamed or not.
- Setup alert to be integrated with slack
- Go to
setting
page -> alert
- Create new rule for your services, and integrate it with slack/ pagerduty.
References: