GitLab

Sentry’s GitLab integration helps you find and fix bugs faster by using data from your GitLab commits. Additionally, you can streamline your triaging process by creating a GitLab issue directly from Sentry.

Configure GitLab

  1. In Sentry, navigate to Organization Settings > Integrations.

  2. Within Integrations, find the GitLab icon and click Install.

    GitLab icon and install button

  3. In the resulting modal, click Add Installation.

    Connect Sentry to a GitLab instance

  4. In the pop-up window, complete the instructions to create a Sentry app within GitLab. Once you’re finished, click Next.

    Configuration modal and Sentry app within GitLab

  5. Fill out the resulting GitLab Configuration form with the following information:

    1. The GitLab URL is the base URL for your GitLab instance. If using gitlab.com, enter https://gitlab.com/.

    2. Find the GitLab Group Path in your group’s GitLab page.

      GitLab page showing group path

    3. Find the GitLab Application ID and Secret in the Sentry app within GitLab.

      GitLab application id and secret

    4. Use this information to fill out the GitLab Configuration and click Submit.

      GitLab configuration form

  6. In the resulting panel, click Authorize.

  7. In Sentry, return to Organization Settings > Integrations. You’ll see a new instance of GitLab underneath the list of integrations.

  8. Next to your GitLab Instance, click Configure. Note: It’s important to configure to receive the full benefits of commit tracking.

    GitLab instance with connected group and highlighted configure button

  9. On the resulting page, click Add Repository to select which repositories in which you’d like to begin tracking commits.

    Add repository

Issue Management

Issue tracking allows you to create GitLab issues from within Sentry and link Sentry issues to existing GitLab issues.

  1. Select your issue

    List of unresolved issues

  2. Navigate to Linked Issues on the right panel of the issue’s page and click Link GitLab Issue.

    GitLab logo with Link GitLab Issue text

  3. You have two options to complete the issue link:

    1. In the pop-up, you can fill out the appropriate details in the Create tab, and then click Create Issue.

      pop-up modal to create issue

    2. Or, in the pop-up, you can click the Link tab, search the issue by name, and then click Link Issue. Note: Issues aren’t currently searchable by number.

      pop-up modal to search issue name

  4. To unlink an issue, click on the X next to its name under Linked Issues.

    GitLab logo and project next to an X icon

Commit Tracking

Commit tracking allows you to hone in on problematic commits. With commit tracking, you can better isolate what might be problematic by leveraging information from releases like tags and metadata.

Once you’ve configured both release and commit tracking, you’ll be able to see more thorough information about a release: who made commits, which issues were newly introduced by this release, and which deploys were impacted.

Dashboard with last commit highlighted

When you investigate deeper into that commit, you can leverage information from metadata like tags.

Issue detail highlighting tags

Broadly, this lets you isolate problems in order to see which commits might be problematic.

Learn more about release and commit tracking.

Suspect Commit

Once you are tracking the commits, the ‘suspect commit’ is the commit that likely introduced the error.

One special benefit of using Sentry’s Commit Tracking is the ability to know the suspect commit that likely caused the error, with a suggested plan of action for how to rectify the error. For example, after pinpointing the suspect commit, you can also identify the developer who made the commit and assign them the task of fixing the error.

Issue detail highlighting suspect commits

Here is where you can find info for suspect commit setup.

Resolve via Commit or PR

Once you’ve added a repository (see configuration step 8), you can start resolving issues by including fixes -ID> in your commit messages. You might want to type something in the commit like: “this fixes MyApp-AB12” or “Fixes MyApp-317”. The keyword to include is fixes. You can also resolve issues with pull requests by including fixes -ID> in the title or description. This will automatically resolve the issue in the next release.

A -ID> may look something like ‘BACKEND-C’ in the image below.

Issue detail highlighting suspect commits

Troubleshooting

FAQ:

  • I’m using GitLab on-premise. Do I need to whitelist Sentry’s IP addresses?
    • Yes. You can find our IP ranges here .
  • Do you support subgroups?
    • Currently, we only support subgroups for users using GitLab 11.6 or higher.
  • My repositories are hosted under my user account, not a group account. Can I still use this integration?
    • Unfortunately, not. The GitLab integration only works for repositories that are hosted under group accounts.
  • Are there pricing restrictions?
  • Who has permission to install this?
    • You must have both owner/manager permissions in Sentry and owner permissions in GitLab to successfully install this integration.