What you can do
- Suspect commits: Sentry automatically identifies the commit most likely responsible for a regression and shows it on the issue detail page.
- Stack trace linking: Click any frame in a Sentry stack trace to open the exact line of code in GitHub.
- CODEOWNERS import: Import your
CODEOWNERSfile to automatically assign Sentry issues to the team or individual responsible for the affected code. - GitHub issue creation: Create a GitHub issue directly from a Sentry issue, or link to an existing one.
- Assignee sync: Syncing assignees between Sentry and GitHub keeps both systems consistent without manual updates.
- Status sync: Optionally resolve or unresolve a Sentry issue when the linked GitHub issue is closed or reopened.
- PR comments: When a pull request is merged, Sentry posts a comment listing the issues attributed to commits in that PR.
- Ticket rules: Use alert rules to automatically create GitHub issues when new Sentry issues meet specific conditions.
Install the GitHub integration
Authorize with GitHub
You are redirected to GitHub. Choose the GitHub organization or user account you want to connect, then click Install to install the Sentry GitHub App.
You need to be an owner of the GitHub organization to install the app. If you are not an owner, you can request installation and a GitHub admin will need to approve it.
Grant repository access
Select which repositories the app can access—either all repositories or specific ones. Sentry uses this access to read commit data and link stack frames.
Link repositories to Sentry projects
After installation, you need to tell Sentry which repositories belong to your projects.Set up commit tracking
Commit tracking lets Sentry identify the exact commit that introduced a bug. To get the most accurate suspect commit data:- Create a Sentry release in your CI/CD pipeline using the Sentry CLI or one of the Sentry SDKs. See Releases for details.
- Associate commits with the release using
sentry-cli releases set-commitsor thesetCommitsSDK method.
Configure code mappings
Code mappings tell Sentry how the file paths in your stack traces map to files in your GitHub repository. Without a code mapping, stack trace links and suspect commits may not work correctly.Open code mappings
Go to Settings > Integrations > GitHub > Configure, then scroll to Code Mappings.
Add a mapping
Click Add Code Mapping and fill in:
- Repository: The GitHub repository that contains your source code
- Branch: The default branch (for example,
main) - Stack trace root: The path prefix that appears in your stack frames (for example,
src/) - Source code root: The corresponding path in the repository (for example,
src/)
Import CODEOWNERS
If your repository has aCODEOWNERS file, Sentry can use it to automatically assign issues to the correct team or person.
Go to Settings > Integrations > GitHub > Configure and click Sync CODEOWNERS. Sentry reads the file from the locations CODEOWNERS, .github/CODEOWNERS, or docs/CODEOWNERS.
CODEOWNERS-based assignment works alongside your Sentry ownership rules. Sentry ownership rules take priority if both apply.
Create and link GitHub issues
From any Sentry issue detail page:- Click Link GitHub Issue in the sidebar.
- Choose to create a new issue or search for an existing one.
- Select the repository and fill in the issue details.
Sync settings
You can configure bidirectional status and assignee syncing from Settings > Integrations > GitHub > Configure:| Setting | What it does |
|---|---|
| Sync GitHub Status to Sentry | Resolves or unresolves the Sentry issue when the linked GitHub issue is closed or reopened |
| Sync GitHub Assignment to Sentry | Assigns the Sentry issue when the GitHub issue is assigned |
| Sync Sentry Assignment to GitHub | Assigns the GitHub issue when the Sentry issue is assigned |
| Sync Sentry Comments to GitHub | Posts Sentry comments to the linked GitHub issue |
| Sync Sentry Status to GitHub | Changes the GitHub issue status when the Sentry issue status changes |
Automatic GitHub issue creation with alert rules
You can configure alert rules to automatically create a GitHub issue whenever a new Sentry issue matches certain conditions.- Go to Settings > [Project] > Alerts and create or edit an alert rule.
- Under Actions, select Create a GitHub issue.
- Choose the repository, title template, and any other fields.