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

  1. In the OpsLevel app, Click Integrations in the left sidebar.
  2. Click on the + New Integration button.
  3. Click the Sentry tile to add the integration.

Create a Check

  1. Navigate to the Rubrics sub menu under the Service Health menu in OpsLevel
  2. Hover over the cell that corresponds to the level and category you want your check to live in and click the + Add Check button.

Add Check

  1. Create a Custom Event check
  2. Select the Sentry integration you created from the Integration dropdown
  3. 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)
  1. 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.

Service Specifier and Success Condition

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.

-H "Authorization: Bearer ${SENTRY_API_KEY}" | \
curl -X POST curl -X POST \
-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.

Webhook URL

To learn more about Sentry, check out their docs on the Issues endpoint.