Today I want to talk about one service I’ve discovered for myself last week. As you probably already got from article title it is Sentry.io. This open source project helps you to aggregate and monitor information regarding errors happening in your application. Beside opensource version, there is also hosted paid(with free Hobbyist plan) version which supposes to be the same.
This service provides wide support for different programming languages like Java, C#, Elixir, Go, Javascript, Node, Perl, PHP, Python, etc. The integration process is super easy — you just need to add proper dependency into your project and provide a little bit of configuration(at least access token), and you are ready to go.
In my case, it was a Spring-Boot application with logback logging framework. Both those technologies are supported by Sentry.io. So, I’ve placed io.sentry:sentry-spring and io.sentry:sentry-logback libraries into projects Gradle script. Then I’ve created a new project inside Sentry’s dashboard and generated a token for it. Next step — configuration inside the project. And that is something I don’t like about all that story. Maybe there is some way around but I can’t find it — so, I had to duplicate configuration twice — for logback and for spring-boot respectively. I’ve added sentry.properties file in project’s resource folder with dsn key inside and sentry.dsn key to my application.yaml. Also, the configuration of logback appenders was updated with the following block:
And as a final step additional beans for Spring to handle unhandled exceptions and provide additional request context(yes, a little bit of Kotlin ):
That’s it.
But there is much more than just aggregation of errors. Sentry provides useful report channels integrations. For example, it can send notifications by email or to S lack when there is a new type of error. Or notify you if same error happened more then 100 times per hour. All those rules are extremely flexible and can be configured with Sentry’s dashboard.
And there is integration with popular issue trackers like Jira. So, it will create a new bug ticket for each new error with stacktrace and all context it has. That should make it easier to fix them.
So far looks good.
Top comments (0)