gitlab-org--gitlab-foss/doc/operations/error_tracking.md

5.3 KiB

stage group info
Monitor Monitor To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments

Error Tracking (FREE)

Introduced in GitLab 11.8.

Error Tracking allows developers to easily discover and view the errors that their application may be generating. By surfacing error information where the code is being developed, efficiency and awareness can be increased.

Sentry error tracking

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

Deploying Sentry

You can sign up to the cloud hosted Sentry, deploy your own on-premise instance, or use GitLab to install Sentry to a Kubernetes cluster. To make this easier, we are considering shipping Sentry with GitLab.

Enabling Sentry

GitLab provides an easy way to connect Sentry to your project. You need at least Maintainer permissions to enable the Sentry integration.

  1. Sign up to Sentry.io or deploy your own Sentry instance.
  2. Create a new Sentry project. For each GitLab project that you want to integrate, we recommend that you create a new Sentry project.
  3. Find or generate a Sentry auth token for your Sentry project. Make sure to give the token at least the following scopes: event:read, project:read, and event:write (for resolving events).
  4. In GitLab, navigate to your project's Monitor > Error Tracking page, and click Enable Error Tracking.
  5. Navigate to your project's Settings > Monitor. In the Error Tracking section, ensure the Active checkbox is set.
  6. In the Sentry API URL field, enter your Sentry hostname. For example, enter https://sentry.example.com if this is the address at which your Sentry instance is available. For the SaaS version of Sentry, the hostname is https://sentry.io.
  7. In the Auth Token field, enter the token you previously generated.
  8. Click the Connect button to test the connection to Sentry and populate the Project dropdown.
  9. From the Project dropdown, choose a Sentry project to link to your GitLab project.
  10. Click Save changes for the changes to take effect.
  11. You can now visit Monitor > Error Tracking in your project's sidebar to view a list of Sentry errors.

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

Error Tracking List

Users with at least Reporter permissions can find the Error Tracking list at Monitor > Error Tracking in your project's sidebar. Here, you can filter errors by title or by status (one of Ignored , Resolved, or Unresolved) and sort in descending order by Frequency, First Seen, or Last Seen. By default, the error list is ordered by Last Seen and filtered to Unresolved errors.

Error Tracking list

Error Details

From error list, users can navigate to the error details page by clicking the title of any error.

This page has:

  • A link to the Sentry issue.
  • A link to the GitLab commit if the Sentry release ID/version on the Sentry Issue's first release matches a commit SHA in your GitLab hosted project.
  • Other details about the issue, including a full stack trace.
  • In GitLab 12.7 and newer, language and urgency are displayed.

By default, a Create issue button is displayed:

Error Details without Issue Link

If you create a GitLab issue from the error, the Create issue button changes to a View issue button and a link to the GitLab issue displays within the error detail section.

Taking Action on errors

You can take action on Sentry Errors from within the GitLab UI.

Ignoring errors

Introduced in GitLab 12.7.

From within the Error Details page you can ignore a Sentry error by clicking the Ignore button near the top of the page.

Ignoring an error prevents it from appearing in the Error Tracking List, and silences notifications that were set up within Sentry.

Resolving errors

Introduced in GitLab 12.7.

From within the Error Details page you can resolve a Sentry error by clicking the Resolve button near the top of the page.

Marking an error as resolved indicates that the error has stopped firing events. If a GitLab issue is linked to the error, then the issue closes.

If another event occurs, the error reverts to unresolved.