Skip to content
DocsGitHub

span

List and view spans in projects or traces

sentry span list <org/project/trace-id...>

Section titled “sentry span list <org/project/trace-id...>”

List spans in a project or trace

Arguments:

Argument Description
<org/project/trace-id...> [<org>/<project>] or [<org>/<project>/]<trace-id>

Options:

Option Description
-n, --limit <limit> Number of spans (<=1000) (default: "25")
-q, --query <query> Filter spans (e.g., "op:db", "project:backend", "project:[cli,api]")
-s, --sort <sort> Sort order: date, duration (default: "date")
-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:

Terminal window
# List recent spans in the current project
sentry span list
# Find all DB spans
sentry span list -q "op:db"
# Slow spans in the last 24 hours
sentry span list -q "duration:>100ms" --period 24h
# Sort by slowest first
sentry span list --sort duration
# List spans within a specific trace
sentry span list abc123def456abc123def456abc12345
# Show only spans from one project within a trace
sentry span list my-org/cli-server/abc123def456abc123def456abc12345
# Filter a trace's spans to several projects
sentry span list abc123def456abc123def456abc12345 -q "project:[cli-server,api]"
# Fetch the next page
sentry span list -c next
# List spans in an explicit project
sentry span list my-org/cli-server
# Find a project across organizations, then list a trace
sentry span list cli-server abc123def456abc123def456abc12345
# Fetch the next page of a trace
sentry span list abc123def456abc123def456abc12345 -c next

View details of specific spans

Arguments:

Argument Description
<trace-id/span-id...> [<org>/<project>/]<trace-id> <span-id> [<span-id>...] - Trace ID and one or more span IDs

Options:

Option Description
--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:

Terminal window
# View a single span
sentry span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890
# View multiple spans at once
sentry span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890 b2c3d4e5f6789012
# Specify the organization and project explicitly
sentry span view my-org/backend/abc123def456abc123def456abc12345 a1b2c3d4e5f67890

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