Integrating GitHub with Sentry to Increase Speed to Resolution
August 8, 2022 // 4 min read
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
By: Angela Jiang, Product Marketing Manager @Sentry
Sentry is an application monitoring platform that helps over 3.5 million developers see what actually matters, solve quicker, and learn continuously about their applications - from the frontend to the backend.
Toolchains are complicated—developers and engineering managers are working with more tools than they probably care to count. In order to maintain efficiency in today’s world, having smart integrations in place is becoming less of a nice-to-have and more of a necessity.
At Sentry, we're focusing on improving the developer workflow and that means in part building deeper integrations with tools like Github to make it easier for developers to monitor every stage of the release cycle - giving developers a more automated deployment workflow to catch errors as quickly as code is shipped 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
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 Release Health tab within Sentry to monitor the stability, user adoption, and issues in a release so you can identify and stop the roll out of a bad release before it impacts customers. Within Release Health, you will see historical commit details and key stats like user adoption, application usage, and crash-rates. You can also view new, unhandled, regressed issues, and related performance problems in each release.
With the Sentry Release GitHub Action installed, every new release (major or minor) will be automatically recorded and suspect commits automatically configured. Sentry will also upload the original, untransformed source code (aka sourcemaps) which un-minifies any Javascript code that is present. You can see when a release is not trending well by looking at key metrics such as the user adoption and crash-free session rate.
With the GitHub CODEOWNERS file synced to Sentry’s Code Owners rules, Sentry will not only capture the issue impacting users, but will also surface the specific commit related to the issue and automatically suggest the right team member to triage the issue. This way, you no longer need to scramble to figure out who is responsible for what when critical outages occur.
From here, you can create a GitHub issue directly from Sentry and tag the suggested assignee to an issue.
By clicking into the Sentry error report, the developer assigned to the issue can see the stack trace and easily navigate to the relevant GitHub file that is deep linked in the stack trace to investigate the issue further.
Lastly, the developer who owns the issue can quickly identify what the problem is, fix it, and open 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, mark 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 and want to try it out for free? Sign up or try out the latest version of the Action here.
Tags