In this article, you are going to learn the integration of Spring boot and sentry.
What us Sentry:
Self-hosted and cloud-based application monitoring that helps software teams see clearer, solve quicker, & learn continuously. Sentry is help developers from error tracking to performance monitoring, and developers can see what actually matters, solve quicker, and learn continuously about their applications - from the frontend to the backend.
To learn more click here Sentry.
In production, there are some exceptions or error that occurs but it's easy to understand finding the root cause and tracing out that bug or exception is really a skillful job. When your customers are using the application and found that application issue, How do you get to know about that problem so you can fix the problem before customers start to complain about the application?
In order to integrate sentry in your spring boot, all you need to do is add its dependency in your
build.gradle and add some properties in your
Add the following dependency in your
For Maven users:
<dependency> <groupId>io.sentry</groupId> <artifactId>sentry-spring-boot-starter</artifactId> <version>6.0.0</version> </dependency>
Sentry supports Spring Boot 2.1.0 and above to report unhandled exceptions.
Then add your sentry DSN in your application property file.
To do the validation of integration with the sentry. just throw a new exception from your application code.
throw new SentryDemoException("This is a Validation Exception.");
Go to your sentry dashboard and you are able to see the exception.
Sentry is free to use for personal use.
Sentry is easily giving all the insights on the dashboard and it also supports integration with other platforms like Slack, and Squadcast so that your team can be notified.
In this article, you learned the integration of sentry and spring boot in easy steps. It's free for personal use. The good thing about sentry is, that it is providing a wide range of tools to integrate with a different platform so that your team gets notified and takes quick action.
More such articles:
If this article adds any value for you then please clap and comment.