Connect your GitLab source code to Sentry
Connect GitLab to Sentry so errors point straight at the code that caused them. You'll create an application in GitLab, link groups, and add repositories to unlock code mapping, stack trace linking, and Seer.
Before you start
Accounts & access
- Sentry account with the owner, manager, or admin role (required to install integrations)
- A GitLab account with owner or maintainer permissions on the group you want to connect
- Access to a GitLab group (on gitlab.com or a self-managed instance) containing the repositories you want to track
Knowledge
- Familiarity with your GitLab group structure and where your project source lives
- Basic understanding of Sentry issues and stack traces
1 Find GitLab on the Sentry integrations page
In Sentry, go to Settings → Integrations and find GitLab under Source Code Management. Click into it to open the integration detail page, then click Add Installation. A configuration modal appears with instructions for the GitLab side of the setup — keep this window open, you'll come back to it after creating the app in GitLab. If you don't see an Add Installation button, your Sentry role isn't high enough; you need owner, manager, or admin.
GitLab integration docs 2 Create the Sentry application in GitLab
In GitLab, add a new application either at the group level (Group → Settings → Access → Applications) or user level (User Settings → Access → Applications). Use the group settings if the repositories you plan to connect are owned by a team. You can also register the application instance-wide if you are self-hosting GitLab. Fill in the fields as show in the Sentry modal, then save. GitLab will display an Application ID and a Secret — copy both, you'll paste them into Sentry in the next step. The redirect URI must match Sentry exactly, and Confidential must stay checked.
Return to the Sentry installation modal and click Next. Complete the configuration form with your GitLab details. Paste in the Application ID and Secret you copied from GitLab, then submit. Sentry redirects you to GitLab to authorize the app — approve it to complete the connection.
- Name —
Sentry - Redirect URI —
https://sentry.io/extensions/gitlab/setup/ - Scopes — check
api - Confidential — leave checked
- Expire access tokens — leave checked
3 Set up code mappings for stack trace linking
Code mappings tell Sentry how the file paths in your stack traces line up with the files in your GitLab repo, so each frame can link straight to the source. Go to Settings → Integrations → GitLab → Configurations, then navigate to Configure → Code Mappings, and add a mapping for each project: pick the Sentry project, the connected repository, the default branch (usually main or master), and the stack trace root / source code root if your deployed paths differ from your repo layout. Sentry can often suggest mappings automatically once code is connected. With a mapping in place, the Open in GitLab** links appear on stack frames in your issues.
4 Verify suspect commits and unlock Seer
Setting up this connection lets you open a recent issue in Issues and see Suspect Commits, which names the commit and author that are most likely responsible for the error. It's all powered by the release and commit data GitLab now sends. Stack frames should show Open in GitLab links from the mappings in step 4. Because Seer also reads your connected repositories, it can now run Root Cause Analysis against your actual code and open merge requests with fixes. To send commit data with your releases, associate commits during deploys with sentry-cli releases set-commits.
5 Enable Self-healing with Seer
Now that your project and repository are fully connected, you can set up Seer to handle fixing issues on your behalf. Navigate to the Seer Settings and press + Add Project. Select the project you want to enable Seer for and the corresponding repository. Then choose the automation steps you would like Seer to complete on your behalf. A quick note, currently only Seer's native agent are available for GitLab. Press Save Project.
Note that you can add multiple repositories in case your project is monitoring an application that is spread across multiple code repos.
Seer Autofix documentationThat's it.
Your errors now point at the code.
With GitLab connected, Sentry links stack frames to source, blames the commit that likely caused each issue, and gives Seer the repository access it needs to suggest real fixes.
- Added the GitLab integration to your Sentry organization
- Created a GitLab application for Sentry with the correct redirect URI and scopes
- Linked your GitLab group to Sentry using the Application ID and Secret
- Connected a repository to a Sentry project
- Set up code mappings so stack traces link directly to source in GitLab
- Setup Seer automation to create a plan for issues fixes or open a merge request for you
Pro tips
- 💡 Create the GitLab OAuth app under a group (or a dedicated service account) rather than a personal user account — if the person who set it up leaves and their account is removed, a personal app breaks the whole integration.
- 💡 Add every repository that ships code to your Sentry projects. Suspect commits, code mappings, and Seer can only see repos you've explicitly connected in the Configure step.
- 💡 Let Sentry auto-suggest code mappings first, then only hand-edit the stack trace root and source root when your deployed file paths differ from your repository layout.
- 💡 Send commit data with your releases (via CI or
sentry-cli releases set-commits --auto) so suspect commits have the history they need to blame the right change.
Common pitfalls
- ⚠️ The redirect URI must be exactly
https://sentry.io/extensions/gitlab/setup/. A trailing-slash or http/https mismatch is the most common reason the authorization step fails. - ⚠️ Forgetting to check Confidential on the GitLab application will cause the connection to fail — it must stay enabled.
- ⚠️ The Group Path field expects a group or subgroup, not a project URL. Pointing it at a single project's URL will not work.
- ⚠️ Suspect commits only appear once commit data is associated with your releases. If the section is empty, your releases aren't sending commits yet — wire up
set-commitsin your deploy pipeline.
Frequently asked questions
sentry-cli releases set-commits --auto in CI. Once commits are linked to a release, the Suspect Commits section populates automatically.What's next?
Fix it, don't just observe it.
Get started with the only application monitoring platform that empowers developers to fix application problems without compromising on velocity.