Commands
trace
View distributed traces
Commands
sentry trace list <org/project>
List recent traces in a project
Arguments:
| Argument | Description |
|---|---|
<org/project> | <org>/<project> or <project> (search) |
Options:
| Option | Description |
|---|---|
-n, --limit <limit> | Number of traces (1-1000) (default: "20") |
-q, --query <query> | Search query (Sentry search syntax) |
-s, --sort <sort> | Sort by: date, duration (default: "date") |
-t, --period <period> | Time period (e.g., "1h", "24h", "7d", "30d") (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) |
sentry trace view <org/project/trace-id...>
View details of a specific trace
Arguments:
| Argument | Description |
|---|---|
<org/project/trace-id...> | [<org>/<project>/]<trace-id> - Target (optional) and trace ID (required) |
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 |
sentry trace logs <org/trace-id...>
View logs associated with a trace
Arguments:
| Argument | Description |
|---|---|
<org/trace-id...> | [<org>/]<trace-id> - Optional org and required trace ID |
Options:
| Option | Description |
|---|---|
-w, --web | Open trace in browser |
-t, --period <period> | Time period to search (e.g., "14d", "7d", "24h"). Default: 14d (default: "14d") |
-n, --limit <limit> | Number of log entries (<=1000) (default: "100") |
-q, --query <query> | Additional filter query (Sentry search syntax) |
-s, --sort <sort> | Sort order: "newest" (default) or "oldest" (default: "newest") |
-f, --fresh | Bypass cache, re-detect projects, and fetch fresh data |
All commands support --json for machine-readable output and --fields to select specific JSON fields.
Examples
List traces
# List last 20 traces (default)sentry trace list
# Sort by slowest firstsentry trace list --sort duration
# Filter by transaction name, last 24 hourssentry trace list -q "transaction:GET /api/users" --period 24h
# Paginate through resultssentry trace list my-org/backend -c nextView a trace
# View trace details with span treesentry trace view abc123def456abc123def456abc12345
# Open trace in browsersentry trace view abc123def456abc123def456abc12345 -w
# Auto-recover from an issue short IDsentry trace view PROJ-123View trace logs
# View logs for a tracesentry trace logs abc123def456abc123def456abc12345
# Search with a longer time windowsentry trace logs --period 30d abc123def456abc123def456abc12345
# Filter logs within a tracesentry trace logs -q 'level:error' abc123def456abc123def456abc12345