Sentry Integration
Integrate with Sentry to ensure Sentry is enabled on all the appropriate services. Or check that your services are below thresholds for unresolved Sentry issues
Add Sentry Integration
- In the OpsLevel app, Click Integrations in the left sidebar.
- Click on the + New Integration button.
- Click the Sentry tile to add the integration.
Create a Check
- Navigate to the Rubrics sub menu under the Service Health menu in OpsLevel
- Hover over the cell that corresponds to the level and category you want your check to live in and click the + Add Check button.
- Create a Custom Event check
- Select the Sentry integration you created from the Integration dropdown
- Choose one of the Check Templates from the dropdown.
The two Sentry templates are:
- Sentry is enabled: A service has an associated Project in Sentry (make sure to only apply this check to services that should have Sentry enabled)
- Less than 5 unresolved Sentry issues: Any service with 5 or more unresolved Sentry issues will fail this check (edit the Success Condition to raise or lower threshold as needed)
- We will populate the Service Specifier field, which we use to determine what service to run the check for, and the Success Condition field, which we use to determine if the check should pass or fail.
If you’d like to check for different scenarios, alter the template’s success condition to your preferred logic. We also provide a sample payload to test the check.
Send JSON payload to OpsLevel
To send OpsLevel the JSON payload containing your Sentry Issues, there are a few pieces of information to obtain from Sentry first:
- ORGANIZATION_SLUG: The slug of the organization to look up.
- PROJECT_SLUG: The slug of the project the groups belong to.
- SENTRY_API_KEY: Authentication Token with project:read scope
Then, using the snippet provided below, you can query Sentry for issues on your project and pipe the data to OpsLevel. We recommend using a cron job to periodically update Opslevel with the latest Sentry results.
curl https://sentry.io/api/0/projects/${ORGANIZATION_SLUG}/${PROJECT_SLUG}/issues/ \
-H "Authorization: Bearer ${SENTRY_API_KEY}" | \
curl -X POST curl -X POST https://app.opslevel.com/integrations/custom_event/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \
-H 'content-type: application/json' --data-binary @-
You will need to substitute the endpoint URL from the Sentry Integration you created in place of xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
.
To learn more about Sentry, check out their docs on the Issues endpoint.
Updated over 1 year ago