Skip to content

Sentry error tracking

DETAILS: Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

Sentry is an open source error tracking system. GitLab enables administrators to connect Sentry to GitLab, so users can view a list of Sentry errors in GitLab.

GitLab integrates with both the cloud-hosted Sentry and Sentry deployed in your on-premise instance.

Enable Sentry integration for a project

GitLab provides a way to connect Sentry to your project.

Prerequisites:

  • You must have at least the Maintainer role for the project.

To enable the Sentry integration:

  1. Sign up to Sentry.io, or deploy your own on-premise Sentry instance.
  2. Create a new Sentry project. For each GitLab project that you want to integrate, create a new Sentry project.
  3. Find or generate a Sentry auth token. For the SaaS version of Sentry, you can find or generate the auth token at https://sentry.io/api/. Give the token at least the following scopes: project:read, event:read, and event:write (for resolving events).
  4. In GitLab, enable and configure Error Tracking:
    1. On the left sidebar, select Search or go to and find your project.
    2. Select Settings > Monitor, then expand Error Tracking.
    3. For Enable error tracking, select Active.
    4. For Error tracking backend, select Sentry.
    5. For Sentry API URL, enter your Sentry hostname. For example, enter https://sentry.example.com. For the SaaS version of Sentry, the hostname is https://sentry.io.
    6. For Auth Token, enter the token you generated previously.
    7. To test the connection to Sentry and populate the Project dropdown list, select Connect.
    8. From the Project list, choose a Sentry project to link to your GitLab project.
    9. Select Save changes.

To view a list of Sentry errors, on your project's sidebar, go to Monitor > Error Tracking.

Enable Sentry's integration with GitLab

You might also want to enable Sentry's GitLab integration by following the steps in the Sentry documentation.

Troubleshooting

When working with Error Tracking, you might encounter the following issues.

Error Connection failed. Check auth token and try again

If the Monitor feature is disabled in the project settings, you might see an error when you try to enable Sentry integration for a project. The resulting request to /project/path/-/error_tracking/projects.json?api_host=https:%2F%2Fsentry.example.com%2F&token=<token> returns a 404 error.

To fix this issue, enable the Monitor feature for the project.