event
View, list, and send Sentry events
Commands
Section titled “Commands”sentry event view <org/project/event-id...>
Section titled “sentry event view <org/project/event-id...>”View details of one or more events
Arguments:
| Argument | Description |
|---|---|
<org/project/event-id...> |
[<org>/<project>] [<event-id>...] - Target (optional) and event IDs, or a selector (default: @latest) |
Options:
| Option | Description |
|---|---|
-w, --web |
Open in browser |
--spans <spans> |
Span tree depth limit (number, "all" for unlimited, "no" to disable) (default: "3") |
-f, --fresh |
Bypass cache, re-detect projects, and fetch fresh data |
Examples:
# View an eventsentry event view abc123def456abc123def456abc12345
# View a specific event using an issue short IDsentry event view PROJ-ABC 7388f6a62b7d436ab77bb5365f97a1ac
# View a specific event with an explicit organizationsentry event view my-org/PROJ-ABC 7388f6a62b7d436ab77bb5365f97a1ac
# View the latest event for an issuesentry event view PROJ-ABC
# View the latest event of the most recent unresolved issue in a projectsentry event view my-org/my-project
# View the latest event of the most frequent issuesentry event view @most_frequent
# Open in the browsersentry event view abc123def456abc123def456abc12345 -w
# Download an attachment listed by --json (with sentry api)sentry api 'https://sentry.io/api/0/projects/my-org/my-project/events/EVENT_ID/attachments/ATTACHMENT_ID/?download=1' > screenshot.png
# View an event in an explicit projectsentry event view my-org/my-project abc123def456abc123def456abc12345
# View several events, finding the project across organizationssentry event view my-project abc123def456abc123def456abc12345 def456abc123def456abc123def45678sentry event list <issue>
Section titled “sentry event list <issue>”List events for an issue
Arguments:
| Argument | Description |
|---|---|
<issue> |
Issue: @latest, @most_frequent, <org>/ID, <org>/<project>#ID, <project>-suffix, ID, or suffix |
Options:
| Option | Description |
|---|---|
-n, --limit <limit> |
Number of events (1-1000) (default: "25") |
-q, --query <query> |
Search query (Sentry search syntax) |
--full |
Include full event body (stacktraces) |
-t, --period <period> |
Time range: "7d", "2024-01-01..2024-02-01", ">=2024-01-01" (default: "7d") |
-f, --fresh |
Bypass cache, re-detect projects, and fetch fresh data |
-c, --cursor <cursor> |
Navigate pages: "next", "prev", "first" (or raw cursor string) |
Examples:
# List events for an issue (short ID)sentry event list PROJ-ABC
# List events for an issue (numeric ID)sentry event list 123456789
# List events for the most recent issuesentry event list @latest --limit 50
# Filter by search querysentry event list PROJ-ABC --query "browser:Chrome"
# Include full event bodies (stacktraces)sentry event list PROJ-ABC --full
# Limit results and time rangesentry event list PROJ-ABC --limit 50 --period 24h
# Fetch the next pagesentry event list PROJ-ABC -c next
# Fetch the previous pagesentry event list PROJ-ABC -c prev
# Output as JSONsentry event list PROJ-ABC --jsonsentry event send <target-or-file...>
Section titled “sentry event send <target-or-file...>”Send a Sentry event
Arguments:
| Argument | Description |
|---|---|
<target-or-file...> |
Optional DSN/project target followed by JSON event file path(s) |
Options:
| Option | Description |
|---|---|
-m, --message <message>... |
Event message (repeat for multi-line) |
-a, --message-arg <message-arg>... |
Arguments for message template (repeat for multiple) |
-l, --level <level> |
Event severity level (default: "error") |
-r, --release <release> |
Release version |
-d, --dist <dist> |
Distribution identifier |
-E, --env <env> |
Environment name (e.g. production, staging) |
-p, --platform <platform> |
Platform identifier (default: other) |
-t, --tag <tag>... |
Tag as KEY:VALUE (repeat for multiple) |
-e, --extra <extra>... |
Extra data as KEY:VALUE (repeat for multiple) |
-u, --user <user>... |
User info as KEY:VALUE — id, email, username, ip_address, or custom |
-f, --fingerprint <fingerprint>... |
Custom fingerprint part (repeat for multiple) |
--timestamp <timestamp> |
Event timestamp (Unix epoch, ISO 8601, or RFC 2822) |
--no-environ |
Do not include environment variables in the event |
--logfile <logfile> |
Path to a log file — last 100 lines are attached as breadcrumbs |
--with-categories |
Parse 'CATEGORY: message' prefixes from logfile breadcrumbs |
--raw |
Send file contents as-is without parsing |
Examples:
# Send an error event (default level)sentry event send -m "Something went wrong"
# Specify level, release, and environmentsentry event send -m "Deploy check" -l info -r 1.0.0 -E production
# Add tags and extra datasentry event send -m "Payment failed" --tag env:prod --tag region:us-east --extra amount:99.99
# Set user contextsentry event send -m "Login error" --user id:42 --user email:alice@example.com
# Custom fingerprint to group related events togethersentry event send -m "DB timeout" --fingerprint db-timeout --fingerprint {{ default }}
# Send a serialized Sentry Event objectsentry event send ./crash.json
# Send without re-parsing (raw mode)sentry event send --raw ./crash.json
# Send a pre-built envelopesentry event send --raw ./captured.envelope
# Send with an explicit DSNsentry event send "https://key@o123.ingest.us.sentry.io/456" -m "Test"
# Send to a project (logged-in session; the CLI fetches its sole active DSN)sentry event send my-project -m "Test"
# Send to an org/project targetsentry event send my-org/my-project -m "Test"sentry event analytics [<org/project>]
Section titled “sentry event analytics [<org/project>]”Analytics for events Sentry accepted and dropped
Arguments:
| Argument | Description |
|---|---|
[<org/project>] |
<org>/<project> or <project> (search) |
Options:
| Option | Description |
|---|---|
-d, --dataset <dataset> |
Dropped-data type: errors, spans, logs, metrics (default: "errors") |
-t, --period <period> |
Time range: "7d", "2024-01-01..2024-02-01", ">=2024-01-01" (default: "7d") |
Examples:
# Accepted and dropped event analytics for a projectsentry event analytics my-org/my-project
# Analytics for a different datasetsentry event analytics my-org/my-project --dataset spans
# Widen the time rangesentry event analytics my-org/my-project --period 7d
# Select specific JSON fieldssentry event analytics my-org/my-project --json --fields outcome,reason,eventsAll commands support --json for machine-readable output and --fields to select specific JSON fields.
Sending from a file
Section titled “Sending from a file”Prefix relative file paths with ./ to distinguish them from a project target.
--raw sends the file without re-parsing and also accepts pre-built envelopes.
DSN authentication
Section titled “DSN authentication”sentry event send authenticates with ingest via a DSN, not a user token.
An explicit DSN, SENTRY_DSN, and project auto-detection do not require login.
Passing <project> or <org>/<project> does: the CLI uses your session to
resolve the project and fetch its active DSN, then sends to ingest. If a project
has multiple active DSNs, pass the desired DSN explicitly.
The DSN is resolved in priority order:
- A leading
<dsn>,<project>, or<org>/<project>positional SENTRY_DSNenvironment variable- Auto-detection from the current project (
.env, source code, env files)
Selecting an event from an issue
Section titled “Selecting an event from an issue”Copy a full event ID from sentry issue events PROJ-ABC and pass it after the
issue short ID to open that event. The issue resolves the project; omitting the
event ID selects the latest event. Invalid event IDs return an error instead of
selecting the latest event.
Selecting an event without an ID
Section titled “Selecting an event without an ID”sentry event view takes the issue selectors @latest (the most recent
unresolved issue) and @most_frequent, and shows the selected issue's latest
event. Without an event ID it uses @latest, so sentry event view and
sentry event view my-org/my-project show the latest event of the most recent
unresolved issue. A selector looks in the given org (my-org/@latest) or project
(my-org/my-project/@most_frequent), otherwise in the auto-detected org, as it
does for sentry issue view.
Attachments
Section titled “Attachments”sentry event view --json lists an event's attachment metadata. Download an
attachment with sentry api and the attachment's ?download=1 URL.
Finding Event IDs
Section titled “Finding Event IDs”Event IDs can be found:
- In the Sentry UI when viewing an issue's events
- In the output of
sentry issue viewcommands - In error reports sent to Sentry (as
event_id)
Backward compatibility
Section titled “Backward compatibility”The old sentry-cli top-level command sentry send-event is available as a
hidden alias for sentry event send.