Skip to content
DocsGitHub

alert

Manage Sentry alert rules

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:

Terminal window
# List issue alert rules (project auto-detected)
sentry alert issues list
# List issue alert rules for a project
sentry alert issues list my-org/my-project
# Filter rules by name
sentry alert issues list my-org/my-project --query "spike"
# List issue alert rules for all projects in an organization
sentry alert issues list my-org/
# Find a project across organizations
sentry alert issues list frontend

sentry 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:

Terminal window
# View an issue alert rule by ID (organization and project auto-detected)
sentry alert issues view 12345
# View by ID in an explicit project
sentry alert issues view my-org/my-project/12345
# View by name
sentry alert issues view my-org/my-project/'Error Spike'

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:

Terminal window
# Alert on new issues and email a team
sentry 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 minutes
sentry 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 names
sentry 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 1440

sentry 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:

Terminal window
# Delete an issue alert rule (prompts for confirmation)
sentry alert issues delete my-org/my-project/12345
# Delete a rule selected by name without prompting
sentry alert issues delete my-org/my-project/'My Rule' --yes
# Preview the deletion
sentry alert issues delete my-org/my-project/12345 --dry-run

sentry 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:

Terminal window
# Rename an issue alert rule
sentry alert issues edit my-org/my-project/12345 --name 'Prod errors'
# Disable a rule selected by name
sentry 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 conditions
sentry alert issues edit my-org/my-project/12345 --condition '{"type":"first_seen_event","comparison":true,"conditionResult":true}'

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:

Terminal window
# List metric alert rules (organization auto-detected)
sentry alert metrics list
# List metric alert rules for an organization
sentry alert metrics list my-org/
# Fetch the next page
sentry alert metrics list my-org/ -c next

sentry 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:

Terminal window
# View a metric alert rule by ID (organization auto-detected)
sentry alert metrics view 12345
# View by ID in an explicit organization
sentry alert metrics view my-org/12345
# View by name
sentry alert metrics view my-org/'P95 latency alert'
# Inspect native thresholds and notification workflows
sentry alert metrics view my-org/12345 --json

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:

Terminal window
# Alert when P95 span duration goes above 500ms
sentry 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 alert
sentry 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-run

sentry 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:

Terminal window
# Delete a metric alert rule (prompts for confirmation)
sentry alert metrics delete my-org/12345
# Delete a rule selected by name without prompting
sentry alert metrics delete my-org/'P95 alert' --yes

sentry 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:

Terminal window
# Rename a metric alert rule
sentry alert metrics edit my-org/12345 --name 'Error budget'
# Disable a rule
sentry alert metrics edit my-org/12345 --status disabled
# Change the query and time window
sentry alert metrics edit my-org/12345 --query "environment:prod event.type:error" --time-window 15
# Switch the dataset
sentry alert metrics edit my-org/12345 --time-window 15 --dataset spans

All commands support --json for machine-readable output and --fields to select specific JSON fields.

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.

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.