How to Integrate GitHub with Sentry to Increase Speed to Resolution
Toolchains are complicated these days - developers and engineering managers are working with more tools than they probably care to count. In order to work efficiently in today’s world, it is essential to have smart integrations in place that bridge the gap between your tools to get you what you need, faster.
At Sentry, we care about improving the developer workflow and that means in part focusing on deep integrations with tools to make it easier for developers to monitor every stage of the release cycle. One of the most popular and impactful integrations we have in our arsenal is the Sentry GitHub integration - this provides a developers an automated deployment workflow that catches errors as code is shippped to production (with no superfluous button-clicking).
Whether you’re already using Sentry and GitHub separately, or building a deployment workflow for the first time, you can follow these steps to create an automated workflow for your team:
Sign in to your Sentry account
Connect your GitHub repositories to Sentry to begin tracking commit data
Import your GitHub CODEOWNERS file to automatically map issues to teams or people in Sentry
Install the Sentry Release GitHub Action in GitHub to automatically upload sourcemaps, manage releases in Sentry and track how the release is trending
Customers like Forethought, who have growing engineering teams and are shipping continuously, often operate with limited visibility into the code they ship and ownership over who should fix what once it's released. In Forethought’s case, integrating their GitHub CODEOWNERS file with Sentry allowed them to divide up and assign responsibilities to specific teams, reducing their time to resolution by up to 94%.
In addition to improving issue ownership, integrating GitHub with Sentry allows customers like Forethought to:
Automatically monitor the health of a new release and its impacts on users with Sentry Release GitHub Actions
Create or link GitHub issues directly in Sentry
Predict which commit caused an issue and who is likely responsible to resolve it
Link Sentry stack traces back to the GitHub source code to see the line of code causing an error
Resolve issues via a pull request or commit
In additon to all the features above, the Sentry GitHub integration also supports stack trace linking and codeowners for mobile (iOS and Android) in addition to web.
Let’s walk through an example of how customers typically use Sentry and GitHub together and how you can see the above in action.
After a release is deployed, you head into your Releases tab in Sentry to check out the stability, user adoption, and any issues that may have been present in the release. Within Release Health, you see historical commit details and key stats like user adoption, application usage, and crash-rates. You also take a look at your new, unhandled, regressed issues, and related performance problems in the release. If there are any major problems, you'll want to stop the roll out before it impacts customers.
With the Sentry Release GitHub Action installed, every new release (major or minor) is automatically recorded and suspect commits automatically configured. The original, untransformed source code, which we call sourcemaps, also gets uploaded to Sentry (this un-minifies any Javascript code present).
With the GitHub CODEOWNERS file synced to Sentry’s Code Owners rules, Sentry not only captures the issue impacting users, but also surfaces the specific commit related to the issue and automatically suggests the right team member to triage the issue. Gone are the days when you have to scramble to figure out who is responsible for what when critical outages occur.
From here, you go ahead and create a GitHub issue in the Sentry UI and tag the suggested assignee to an issue.
The developer on your team who you assigned the issue to gets notified. They click into the Sentry error report to see the stack trace and easily navigates to the relevant GitHub file that is deep linked in the stack trace to investigate the issue further.
The developer quickly identifies what the problem is, fixes it, and opens a pull request with the Sentry Issue ID included in the comments. (Sentry automatically annotates the matching issue with a reference to the commit or pull request, and, later, when that commit or pull request is part of a release, marks the issue as resolved).
By integrating GitHub with Sentry, you will be able to unlock the full potential of both tools to simplify your team’s workflow, increase speed to resolution, and learn from trends to optimize code health over time. As we continue to strive to improve how developers ship and improve software, we'd love to hear from you - what part of the workflow works well, what is completely terrible, and what can we do better?
New to Sentry? Sign up and try out the latest version of the GitHub Action here.