
How do I configure Sentry ownership rules so issues auto-assign to the right team/service?
Most teams don’t lack monitoring data; they lack clear ownership. Ownership Rules in Sentry close that gap: they map issues to the right code owners so new errors, performance issues, and alerts auto-assign to the correct team or service without a weekly “who owns this?” standup.
Quick Answer: Configure Sentry Ownership Rules by mapping files, URLs, tags, and services to teams or users. Once rules are in place, new issues that match those rules are automatically owned and assigned, so production breakages route straight to the people who can fix them.
The Quick Overview
- What It Is: A rule-based system in Sentry that turns code-level signals (file paths, services, URLs, tags) into clear ownership, so issues and alerts auto-assign to the right team or person.
- Who It Is For: Engineering teams with multiple services, repos, or squads that need deterministic routing for errors, slow transactions, and other Sentry issues.
- Core Problem Solved: It eliminates orphaned issues and “triage by Slack thread,” replacing it with predictable, code-aware ownership and assignment.
How It Works
Ownership Rules sit between your events and your people. Sentry takes data from the stack trace, request, tags, and release metadata, then evaluates your Ownership Rules from top to bottom to determine who owns the issue.
When a new issue comes in:
- Sentry evaluates the event (files, modules, URLs, tags, release, etc.).
- It matches these against the rules you configured in Project Settings → Ownership Rules.
- The first matching rules determine the Owners, which Sentry then uses to:
- Mark the issue as owned by a team/user.
- Auto-assign the issue (if auto-assignment is enabled).
- Route alerts and notifications to the right owners.
In practice, you’ll:
- Define ownership sources: Decide if you want to base ownership on file paths, services, URLs, or custom tags.
- Write and test rules: Use Sentry’s rule syntax (
path:,url:,tags[service]=, etc.) to map ownership to@teamoruser@example.com. - Enable auto-assignment and integrate with workflow tools: Turn on auto-assignment, then connect to tools like Linear so the right team gets the right issue, in the right place.
How to Configure Ownership Rules (Step-by-Step)
1. Start in the right project
Ownership is configured per project.
- In Sentry, open the project that receives the events (e.g., your frontend, backend, or service project).
- Go to Project Settings → Ownership Rules (sometimes surfaced as Issue Owners).
You’ll see:
- A rules editor (text area) for manual rules.
- An optional CODEOWNERS integration if you sync from your repo.
- Auto-assignment toggles and ownership behavior options (depending on your plan and UI version).
2. Understand the Ownership Rules syntax
Rules are written one per line. Each line has:
- One or more matchers (conditions).
- One or more owners (users or teams).
General pattern:
matcher1 matcher2 ... owner1 owner2 ...
Common matchers:
path:– matches against file paths in the stack trace.module:– matches module names (language/runtime dependent).url:– matches request URL.tags[...]– matches Sentry tags (e.g.,tags[service]=checkout-api).release:– matches release/version names.dist:– matches distribution/build identifiers.
Common owner targets:
@team-name– a Sentry team (e.g.,@backend,@payments).user@example.com– a specific Sentry user.
Example:
path:src/payments/* @payments-team
tags[service]=checkout-api @payments-team
url:/api/orders/* @orders-team
Rules are evaluated in order; later rules can add or override ownership.
3. Map ownership by service or team
If you’re using microservices or have a “service” tag, your cleanest pattern is usually service-based ownership.
Example for service-based routing:
# All checkout service events
tags[service]=checkout-api @checkout-team
# All auth service events
tags[service]=auth-service @identity-team
# Frontend client service
tags[service]=web-frontend @frontend-team
To make this work:
- Ensure your SDK sets a
serviceor similar tag consistently in each service:-
For example in Python:
sentry_sdk.init( dsn="https://…", traces_sample_rate=1.0, before_send=lambda event, hint: add_service_tag(event, "checkout-api"), ) -
Or directly in code per event:
with configure_scope() as scope: scope.set_tag("service", "checkout-api")
-
Once the tag is present, Ownership Rules can route by that tag.
4. Map ownership by file path (monoliths and large repos)
If you have a single repo with clear directory ownership, use path: matching based on stack traces.
Example for path-based routing:
# Payments-related code
path:src/payments/* @payments-team
# Account management
path:src/accounts/* @accounts-team
# Shared platform libs
path:src/platform/* @platform-team
How it works:
- Sentry takes filenames from the stack trace (e.g.,
src/payments/processor.py). - It checks rules from top to bottom.
- If the file matches
path:src/payments/*,@payments-teambecomes the owner.
For browser apps with bundlers, upload source maps and ensure your frames reference logical source paths (not just minified bundles). Once the stack traces reflect your source, path: rules become much more reliable.
5. Map ownership by URL (for frontend routing)
If your teams own parts of the product by URL (e.g., “Checkout owns /checkout”), URL-based matching makes sense.
Example for URL-based routing:
url:/checkout/* @checkout-team
url:/account/* @accounts-team
url:/admin/* @platform-team
Sentry matches the request URL against these patterns for events that include HTTP context.
6. Map ownership by tags for custom routing
Any tag you set via the SDK can be used in rules:
tags[tenant]tags[region]tags[feature_flag]tags[service](most common)
Example: feature flag or domain-level ownership:
tags[feature_flag]=new-onboarding-flow @growth-team
tags[region]=eu-central @eu-sre-team
This is useful when:
- A single service is shared by multiple teams but features are split by tag.
- SRE or platform teams own issues in a specific region or environment.
7. Combine multiple matchers
You can layer matchers to be more precise.
Example: payments endpoint but only in production
tags[service]=checkout-api tags[environment]=production @payments-oncall
Here, both conditions must match for ownership to apply.
8. Assign to teams vs individuals
Best practice:
- Prefer teams (
@payments-team) over individuals. - Use individuals only when ownership is truly personal or for small teams.
When auto-assignment is enabled, Sentry will:
- Assign to the team (depending on settings) or
- Pick a specific user based on assignment rules (e.g., most active, code owners, etc., depending on your configuration and plan features).
This keeps on-call rotations and team changes from breaking your routing.
CODEOWNERS vs Ownership Rules
If you already have GitHub/GitLab CODEOWNERS, you can sync them into Sentry to bootstrap code-based ownership.
How it typically works:
-
Connect your repo integration (GitHub, GitLab, etc.).
-
Enable CODEOWNERS import in the project.
-
Sentry converts entries like:
/src/payments/* @org/payments-teaminto Sentry-style rules that reference your Sentry teams/users.
When to use CODEOWNERS:
- Your repo ownership is already maintained there.
- You want ownership for stack-trace-based issues to align with your code review ownership.
When to override with custom Ownership Rules:
- You need routing by service tag, URL, environment, or region (things CODEOWNERS doesn’t know about).
- You have multi-repo or multi-service setups where ownership isn’t strictly “this path = this team” in one codebase.
You can use both: CODEOWNERS for file-based ownership, additional Ownership Rules for tag/URL/service-based routing.
Enable Auto-Assignment and Alerts
Ownership alone marks issues as “owned.” To get full value, you should also enable auto-assignment and configure alerts.
1. Turn on auto-assignment
In Project Settings → Issue Owners / Ownership Rules:
- Look for a setting like “Automatically assign issues to the owners” (UI wording may vary by version).
- Enable it.
This ensures:
- When a new issue is created and matches a rule, Sentry automatically sets the Assignee to the owner team/user.
- Follow-up alerts, notifications, and integrations use that assignment.
2. Connect with Linear (and other tools)
With the Linear + Sentry integration:
- You can create a Linear issue from any Sentry error.
- Assign it to a Linear team or teammate, label it, and set priority directly from Sentry.
- When you close the issue in Linear, it resolves in Sentry as well.
Ownership Rules plus the Linear integration means:
- New production issues land in Sentry, get auto-owned, and can be pushed into the right Linear team with correct context attached.
- You avoid “drive-by” tickets that nobody claims because ownership is unclear.
Similarly, for Slack, email, PagerDuty, etc., ownership determines who actually sees the alerts.
Features & Benefits Breakdown
| Core Feature | What It Does | Primary Benefit |
|---|---|---|
| Path & tag-based rules | Matches events by file path, URL, tags (service, region, feature, etc.). | Routes issues to the right team based on real runtime data. |
| Team & user ownership | Assigns ownership to Sentry teams or individuals. | Ensures clear responsibility and faster triage. |
| Auto-assignment & alerts | Auto-assigns new issues and routes alerts based on ownership. | Reduces manual triage and keeps on-call focused. |
| CODEOWNERS import | Uses existing Git CODEOWNERS for stack-trace-based ownership. | Reuses established repo boundaries with minimal setup. |
| Workflow integrations | Passes ownership into tools like Linear, plus notifications and dashboards. | Connects debugging to delivery, not just monitoring. |
Ideal Use Cases
- Best for microservices and multi-team backends: Because you can use
tags[service]and path-based rules to map each service to the right owning team, even when multiple services share an infrastructure or runtime. - Best for complex frontends with multiple product areas: Because you can route by URL, path, or feature flags so “Checkout,” “Account,” and “Admin” issues auto-assign to the teams that actually own those flows.
Limitations & Considerations
- Rules are project-scoped: Ownership Rules are configured per project. If you have 20 services/projects, you’ll want a shared pattern and maybe a documentation page so rules don’t drift.
- Garbage in, garbage out: If stack traces, tags, or URL data are missing or noisy, matching will be weak. Invest in:
- Proper SDK initialization.
- Source maps/symbols for readable traces.
- Consistent tagging (e.g.,
service,environment,region).
- Rule order matters: Rules are evaluated top to bottom. Keep your more specific rules higher and review occasionally to avoid conflicts.
Pricing & Plans
Ownership Rules and team-based work in Sentry are available across paid plans, with governance options expanding on higher tiers.
-
All plans benefit from:
- Per-project ownership configuration.
- Team-based collaboration and routing.
- Security features like Two-Factor Auth, SSL/TLS encryption, and PII data scrubbing.
-
Business+ and Enterprise plans add:
- SAML-based SSO and SCIM for automated provisioning.
- Organization audit logs for tracking changes (including membership and administration).
- Enhanced governance and support options (technical account manager on Enterprise).
Seer (Sentry’s AI debugging add-on) can also leverage ownership context alongside stack traces, spans, commits, logs, and profiling to propose fixes or open pull requests—but it still relies on good ownership hygiene to route work to the right contributors.
Frequently Asked Questions
How do I prioritize one ownership rule over another?
Short Answer: Put the more specific rule higher in the Ownership Rules list; Sentry evaluates from top to bottom.
Details: Ownership Rules are processed sequentially. For example:
tags[service]=checkout-api @checkout-team
path:src/payments/refunds/* @refunds-team
If an event from src/payments/refunds/handler.py in checkout-api should belong to @refunds-team, move the path: rule above the tags[service] rule:
path:src/payments/refunds/* @refunds-team
tags[service]=checkout-api @checkout-team
Periodically review rules and keep:
- Specific, narrow rules at the top.
- Broad, catch-all rules at the bottom (e.g., default owners).
What happens if no Ownership Rules match an issue?
Short Answer: The issue will have no owner; auto-assignment won’t apply unless there’s a default owner configured elsewhere.
Details: If Sentry can’t match any rule:
- The issue is created without an owner.
- Assignments and alerts fall back to your project’s generic alert rules (e.g., notify a default Slack channel or email list).
- Nobody is explicitly responsible, which is exactly what Ownership Rules are meant to avoid.
To mitigate this:
-
Add a broad fallback rule, such as:
tags[environment]=production @core-oncall -
Or a general catch-all path or service rule for critical environments.
-
Monitor “Unowned” issues in Sentry and adjust rules accordingly.
Summary
Configuring Sentry Ownership Rules so issues auto-assign to the right team or service comes down to one thing: making your runtime data (stack traces, URLs, tags, releases) line up with how your teams own the code. Once you define rules that map path:, url:, and tags[service] to your Sentry teams, new issues land with clear ownership and automatic assignment. Layer in CODEOWNERS if you already maintain repo-level ownership, then connect everything to your issue tracker (like Linear) so debugging flows cleanly into delivery.
When production breaks, you shouldn’t need a Zoom call just to decide who’s on the hook. Let Ownership Rules answer that for you.