Features
Suspect commits
Sentry identifies the commits most likely to have introduced an error and links to them in GitLab.
Stack trace linking
Navigate from a stack frame directly to the corresponding line in your GitLab repository.
MR comments
When a merge request is merged, Sentry posts a comment listing the issues detected after merging.
Code owners
Import your
CODEOWNERS file to automatically assign Sentry issues based on who owns the affected code.Issue linking
Create or link GitLab issues directly from a Sentry issue.
Auto-resolve via commit message
Including
Fixes PROJ-ID in a commit message or MR description resolves the linked Sentry issue when the commit is merged.Compared to GitHub
The GitLab integration supports most of the same features as the GitHub integration, with a few differences:| Feature | GitHub | GitLab |
|---|---|---|
| Suspect commits | Yes | Yes |
| Stack trace linking | Yes | Yes |
| Code owners | Yes | Yes |
| Issue linking | Yes | Yes |
| PR/MR comments | Yes | Yes |
| Issue sync (status + assignee) | Yes | Assignee and comments only |
| Self-hosted support | GitHub Enterprise (separate integration) | Yes, built-in |
Installation
Create a GitLab OAuth application
In GitLab, go to your group settings and create an OAuth application with the following settings:
- Name: Sentry
- Redirect URI:
https://sentry.io/extensions/gitlab/setup/ - Scopes:
api
Start the installation in Sentry
Go to Settings > Integrations and find GitLab in the Source Control group. Click Install.
Fill in the configuration form
Enter the following details:
- GitLab URL: The base URL of your GitLab instance. For gitlab.com, enter
https://gitlab.com/. - GitLab Group Path: The path of the group to connect, for example
my-group/my-subgroup. Leave blank to integrate the entire GitLab instance. - Include subgroups: Toggle on to include projects in subgroups.
- Verify SSL: Keep enabled unless your instance uses a self-signed certificate.
- GitLab Application ID and GitLab Application Secret: Paste the values from the OAuth application you created.
For self-managed GitLab instances, ensure that the Sentry server can reach your GitLab host over HTTPS. Outbound webhooks from GitLab also need to reach Sentry’s webhook endpoint.
Stack trace linking
Stack trace linking maps each stack frame to the corresponding line in your GitLab repository. Sentry resolves source paths by matching the stack frame filename against the file tree of the commits included in the release. For linking to work, your project must have a repository connected and release commits tracked.Code owners
Sentry can import yourCODEOWNERS file and use it to assign issues.
Supported CODEOWNERS file locations:
CODEOWNERS.gitlab/CODEOWNERSdocs/CODEOWNERS
Sync the CODEOWNERS file
Click Sync CODEOWNERS. Sentry fetches the file from the default branch of the linked repository.
Issue linking
- Open a Sentry issue.
- In the Linked Issues sidebar section, click Link a GitLab issue.
- Search for an existing issue or create a new one.
Issue sync
The GitLab integration supports optional sync of issue assignment and comments. To configure sync, go to Settings > Integrations > GitLab > Configure:| Option | Description |
|---|---|
| Sync GitLab assignment to Sentry | Assigning an issue in GitLab assigns the linked Sentry issue to the same user. |
| Sync Sentry assignment to GitLab | Assigning an issue in Sentry assigns the linked GitLab issue to the same user. |
| Sync Sentry comments to GitLab | Comments posted on a Sentry issue are mirrored to the linked GitLab issue. |
Auto-resolve via commit message
You can resolve a Sentry issue by including a reference in a GitLab commit message or MR description:PROJ-123 with the short ID of the Sentry issue. When the commit is merged into the default branch, Sentry resolves the issue automatically.