alert
Manage Sentry alert rules
Commands
Section titled “Commands”sentry alert issues list [<org/project>]
Section titled “sentry alert issues list [<org/project>]”List issue alert rules
Arguments:
| Argument | Description |
|---|---|
[<org/project>] |
<org>/ (all projects), <org>/<project>, or <project> (search) |
Options:
| Option | Description |
|---|---|
-w, --web |
Open in browser |
-n, --limit <limit> |
Maximum number of issue alert rules to list (default: "25") |
-q, --query <query> |
Filter rules by name |
-c, --cursor <cursor> |
Pagination cursor (use "next" for next page, "prev" for previous) |
-f, --fresh |
Bypass cache, re-detect projects, and fetch fresh data |
Examples:
# List issue alert rules (project auto-detected)sentry alert issues list
# List issue alert rules for a projectsentry alert issues list my-org/my-project
# Filter rules by namesentry alert issues list my-org/my-project --query "spike"
# List issue alert rules for all projects in an organizationsentry alert issues list my-org/
# Find a project across organizationssentry alert issues list frontendsentry alert issues view <org/project/rule-id-or-name>
Section titled “sentry alert issues view <org/project/rule-id-or-name>”View an issue alert rule
Arguments:
| Argument | Description |
|---|---|
<org/project/rule-id-or-name> |
Issue alert rule ID or name |
Options:
| Option | Description |
|---|---|
-w, --web |
Open issue alert rules page in browser |
Examples:
# View an issue alert rule by ID (organization and project auto-detected)sentry alert issues view 12345
# View by ID in an explicit projectsentry alert issues view my-org/my-project/12345
# View by namesentry alert issues view my-org/my-project/'Error Spike'sentry alert issues create [<target>]
Section titled “sentry alert issues create [<target>]”Create an issue alert rule
Arguments:
| Argument | Description |
|---|---|
[<target>] |
<org>/<project>, auto-detected project, or <project> (search) |
Options:
| Option | Description |
|---|---|
--name <name> |
Rule name |
-c, --condition <condition>... |
Trigger condition JSON or name such as first-seen (repeatable, or pass one JSON array) |
-a, --action <action>... |
Action object JSON (repeatable, or pass one JSON array) |
--frequency <frequency> |
Frequency in minutes (default: 30) |
--environment <environment> |
Environment filter |
--filter <filter>... |
Filter object JSON (repeatable, or pass one JSON array) |
-m, --filter-match <filter-match> |
Filter match mode: all or any |
--owner <owner> |
Owner (team:user style value accepted by Sentry API) |
-n, --dry-run |
Show what would happen without making changes |
Examples:
# Alert on new issues and email a teamsentry alert issues create my-org/my-project --name 'New Issues' --condition '{"type":"first_seen_event","comparison":true,"conditionResult":true}' --action '{"type":"email","data":{},"config":{"targetType":"team","targetIdentifier":"1"}}'
# Preview a high-priority alert that emails a user at most every 30 minutessentry alert issues create my-org/my-project --name 'High Priority' --condition '{"type":"new_high_priority_issue","comparison":true,"conditionResult":true}' --action '{"type":"email","data":{},"config":{"targetType":"user","targetIdentifier":"56789"}}' --frequency 30 --dry-run
# Alert on new issues and regressions, using trigger namessentry alert issues create my-org/my-project --name 'New or Regressed' --condition first-seen,regression --action '{"type":"email","data":{},"config":{"targetType":"team","targetIdentifier":"1"}}'
# Alert when an issue sees more than 50 events in a day (filters only, checked on every event)sentry alert issues create my-org/my-project --name 'Busy Issues' --filter '{"type":"event_frequency_count","comparison":{"value":50,"interval":"1d"},"conditionResult":true}' --action '{"type":"email","data":{},"config":{"targetType":"team","targetIdentifier":"1"}}' --frequency 1440sentry alert issues delete <org/project/rule-id-or-name>
Section titled “sentry alert issues delete <org/project/rule-id-or-name>”Delete an issue alert rule
Arguments:
| Argument | Description |
|---|---|
<org/project/rule-id-or-name> |
Rule id or name (same as view) |
Options:
| Option | Description |
|---|---|
-y, --yes |
Skip confirmation prompt |
-f, --force |
Force the operation without confirmation |
-n, --dry-run |
Show what would happen without making changes |
Examples:
# Delete an issue alert rule (prompts for confirmation)sentry alert issues delete my-org/my-project/12345
# Delete a rule selected by name without promptingsentry alert issues delete my-org/my-project/'My Rule' --yes
# Preview the deletionsentry alert issues delete my-org/my-project/12345 --dry-runsentry alert issues edit <org/project/rule-id-or-name>
Section titled “sentry alert issues edit <org/project/rule-id-or-name>”Edit an issue alert rule
Arguments:
| Argument | Description |
|---|---|
<org/project/rule-id-or-name> |
Rule id or name (same as view) |
Options:
| Option | Description |
|---|---|
--name <name> |
New rule name |
--status <status> |
Rule status: active or disabled |
-c, --condition <condition>... |
Trigger condition JSON or name such as first-seen (repeatable, or pass one JSON array) |
-a, --action <action>... |
Action object JSON (repeatable, or pass one JSON array) |
--frequency <frequency> |
Frequency in minutes |
--environment <environment> |
Environment value (pass empty string to clear) |
--filter <filter>... |
Filter object JSON (repeatable, or pass one JSON array) |
-m, --filter-match <filter-match> |
Filter match mode: all or any |
--owner <owner> |
Owner value (pass empty string to clear) |
Examples:
# Rename an issue alert rulesentry alert issues edit my-org/my-project/12345 --name 'Prod errors'
# Disable a rule selected by namesentry alert issues edit my-org/my-project/'Old name' --status disabled
# Rename and enable a rule (organization and project auto-detected)sentry alert issues edit 12345 --name 'Renamed' --status active
# Replace the rule's conditionssentry alert issues edit my-org/my-project/12345 --condition '{"type":"first_seen_event","comparison":true,"conditionResult":true}'sentry alert metrics list [<target>]
Section titled “sentry alert metrics list [<target>]”List metric alert rules
Arguments:
| Argument | Description |
|---|---|
[<target>] |
<org>/, <org>/<project> (project ignored), or <project> (search) |
Options:
| Option | Description |
|---|---|
-w, --web |
Open in browser |
-n, --limit <limit> |
Maximum number of metric alert rules to list (default: "25") |
-q, --query <query> |
Filter rules by name |
-c, --cursor <cursor> |
Pagination cursor (use "next" for next page, "prev" for previous) |
-f, --fresh |
Bypass cache, re-detect projects, and fetch fresh data |
Examples:
# List metric alert rules (organization auto-detected)sentry alert metrics list
# List metric alert rules for an organizationsentry alert metrics list my-org/
# Fetch the next pagesentry alert metrics list my-org/ -c nextsentry alert metrics view <org/rule-id-or-name>
Section titled “sentry alert metrics view <org/rule-id-or-name>”View a metric alert rule
Arguments:
| Argument | Description |
|---|---|
<org/rule-id-or-name> |
Metric alert rule ID or name |
Options:
| Option | Description |
|---|---|
-w, --web |
Open metric alert rules page in browser |
Examples:
# View a metric alert rule by ID (organization auto-detected)sentry alert metrics view 12345
# View by ID in an explicit organizationsentry alert metrics view my-org/12345
# View by namesentry alert metrics view my-org/'P95 latency alert'
# Inspect native thresholds and notification workflowssentry alert metrics view my-org/12345 --jsonsentry alert metrics create <target>
Section titled “sentry alert metrics create <target>”Create a metric alert rule
Arguments:
| Argument | Description |
|---|---|
<target> |
Target project or organization |
Options:
| Option | Description |
|---|---|
--name <name> |
Rule name |
--query <query> |
Metric query filter string |
--aggregate <aggregate> |
Aggregate expression (for example count(), p95(span.duration)) |
--dataset <dataset> |
Dataset: errors, events, spans, logs, metrics, sessions (error-events is errors; transaction(s) routes to spans) |
--time-window <time-window> |
Evaluation window in minutes |
-t, --trigger <trigger>... |
Trigger object JSON (repeatable, or pass one JSON array) |
-p, --project <project>... |
Project slug filter (repeatable or comma-separated) |
--environment <environment> |
Environment filter |
--owner <owner> |
Owner value accepted by Sentry API |
--workflow <workflow>... |
Alert (workflow) id to notify (repeatable or comma-separated) |
-n, --dry-run |
Show what would happen without making changes |
Examples:
# Alert when P95 span duration goes above 500mssentry alert metrics create my-org/ --name 'P95 latency' --project my-project --query 'environment:prod' --aggregate 'p95(span.duration)' --dataset spans --time-window 5 --trigger '{"alertThreshold":500}'
# Preview an alert on any matching log line that notifies through an existing alertsentry alert metrics create my-org/ --name 'AI chat failures' --project my-project --query 'action:ai.chat result:error' --aggregate 'count()' --dataset logs --time-window 5 --trigger '{"alertThreshold":0,"resolveThreshold":0}' --workflow 12345 --dry-runsentry alert metrics delete <org/rule-id-or-name>
Section titled “sentry alert metrics delete <org/rule-id-or-name>”Delete a metric alert rule
Arguments:
| Argument | Description |
|---|---|
<org/rule-id-or-name> |
Rule id or name (same as view) |
Options:
| Option | Description |
|---|---|
-y, --yes |
Skip confirmation prompt |
-f, --force |
Force the operation without confirmation |
-n, --dry-run |
Show what would happen without making changes |
Examples:
# Delete a metric alert rule (prompts for confirmation)sentry alert metrics delete my-org/12345
# Delete a rule selected by name without promptingsentry alert metrics delete my-org/'P95 alert' --yessentry alert metrics edit <org/rule-id-or-name>
Section titled “sentry alert metrics edit <org/rule-id-or-name>”Edit a metric alert rule
Arguments:
| Argument | Description |
|---|---|
<org/rule-id-or-name> |
Rule id or name (same as view) |
Options:
| Option | Description |
|---|---|
--name <name> |
New rule name |
--status <status> |
active or disabled |
--query <query> |
Metric query filter |
--aggregate <aggregate> |
Aggregate expression |
--dataset <dataset> |
Dataset: errors, events, spans, logs, metrics, sessions (error-events is errors; transaction(s) routes to spans) |
--time-window <time-window> |
Evaluation window in minutes |
-t, --trigger <trigger>... |
Trigger object JSON (repeatable, or pass one JSON array) |
-p, --project <project>... |
Project slug filter (repeatable or comma-separated) |
--environment <environment> |
Environment value (pass empty string to clear) |
--owner <owner> |
Owner value (pass empty string to clear) |
--workflow <workflow>... |
Replace connected alert (workflow) ids (repeatable or comma-separated; empty string disconnects all) |
Examples:
# Rename a metric alert rulesentry alert metrics edit my-org/12345 --name 'Error budget'
# Disable a rulesentry alert metrics edit my-org/12345 --status disabled
# Change the query and time windowsentry alert metrics edit my-org/12345 --query "environment:prod event.type:error" --time-window 15
# Switch the datasetsentry alert metrics edit my-org/12345 --time-window 15 --dataset spansAll commands support --json for machine-readable output and --fields to select specific JSON fields.
Metric alert triggers
Section titled “Metric alert triggers”Triggers take alertThreshold, an optional label (critical or warning),
resolveThreshold, and thresholdType (0 above, 1 below). Notification
actions are not part of triggers; pass --workflow with the ID of an existing
alert to notify.
Inspect metric alert notifications
Section titled “Inspect metric alert notifications”The detail view includes detection settings, threshold conditions, and linked
notification workflows with their filters, destinations, and enabled states.
Use --json to inspect native config, conditionGroup, workflowIds, and
complete workflows documents. Linked workflows that return 403 or 404 appear
in workflowErrors; their notifications could not be inspected. This is the
current configuration, not a record of alert firings or notification delivery.