---
title: "Sentry"
description: "Connect Sentry so the SRE Agent can investigate production issues and open fix pull requests."
canonical: "https://baz.ai/docs/integrations/observability/sentry"
---

# Sentry

Connect Sentry so the SRE Agent can investigate production issues and open fix pull requests.

Connect Sentry to give the [SRE Agent](/docs/agents/maintain/sre-agent) your production issues. Each day the agent fetches issues from the Sentry projects you select, finds the root cause at the deployed commit, and opens fix pull requests for the ones it can fix safely.

## Before you start

You need a Sentry auth token with `event:read`, `org:read`, and `project:read`, your Sentry base URL and organization slug, and the SRE Agent turned on in **Software Factory → Maintain**, plus write access and a [sandbox](/docs/integrations/sandbox) on the repositories it should fix.

## Connect Sentry

<Steps>
  <Step title="Open the Sentry integration">
    Go to **Settings → Integrations**, select **Observability**, then **Sentry**, and select **Configure**.
  </Step>
  <Step title="Fill in the form">
    In **Create a new Sentry integration**, enter **Base URL** (for example `https://sentry.io`), **Organization Slug** and **Auth Token**. Save the form.
  </Step>
  <Step title="Choose projects and environments">
    Open the integration's menu and select **SRE Settings**. Under **Projects**, select the projects to investigate, and for each one pick environments or leave **All environments**.
  </Step>
  <Step title="Map projects to repositories">
    Under **Service to repository mapping**, map each Sentry project to its repository. Turn on **Use tags** to map by service tag instead of project.
  </Step>
  <Step title="Set the priority filter">
    Under **Issue priority filter**, choose which Sentry priorities Baz investigates: All, Low, Medium or High.
  </Step>
</Steps>

## Troubleshooting

<Accordion>
  <AccordionItem title="Invalid Sentry credentials">
    Check the base URL, organization slug and token scopes, then try again.
  </AccordionItem>
  <AccordionItem title="One Sentry project per service">
    Select every relevant project in **Projects** and map each one to its repository.
  </AccordionItem>
</Accordion>

## Related

<CardGroup cols={2}>
  <Card title="SRE Agent" href="/docs/agents/maintain/sre-agent" icon="siren">
    How production issues become fix pull requests.
  </Card>
  <Card title="Datadog" href="/docs/integrations/observability/datadog" icon="activity">
    Another observability source for the SRE Agent.
  </Card>
</CardGroup>
