For the complete documentation index, see llms.txt. This page is also available as Markdown.

Monitor errors with Sentry

Goal

Configure Sentry as a monitoring system for an existing Poja Application using Poja's built in Sentry integration.

How-to

Configure the Sentry project

  • Create an account on https://sentry.io

  • Create a new or select an already existing one

    • For development purposes, we will configure our project to notify us when there is more than one error occurrence

  • Copy your Sentry DSN from [Your Project] > Settings > SDK Setup > Client Keys (DSN), which will be used by the application to send events to the Sentry project

Configure the Poja application

  • Create a new application on the Poja console or select an already existing one

  • Select an environment (PROD or PREPROD)

  • Edit the application's configuration as follows:

    • Enable the Sentry integration

  • Create the SENTRY_DSN environment variable and paste the previously copied DSN from your Sentry project

Sentry environment

You can optionally set the SENTRY_ENVIRONMENT environment variable if you want a custom name for your environment when retrieving errors on Sentry Dashboard

  • Click on the Savebutton and wait for the deployment to complete

Test the Sentry Integration

Integrate the following endpoint, commit and push to the preprod branch and wait for the deployment to finish.

Once the deployment is successful, visit /exception and the error should appear on your Sentry dashboard.

Test the Sentry Logback integration

Poja's Sentry integration comes with an builtin configuration of Sentry's Logback which allows you to see errors logged with Lombok's Slf4j.

Here's an updated version of ErrorController :

Deploy your application and visit /log-error and voilà!

Last updated

Was this helpful?