Skip to content
Docs GitHub

span

List and view spans in projects or traces

Commands

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

List spans in a project or trace

Arguments:

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

Options:

OptionDescription
-n, --limit <limit>Number of spans (<=1000) (default: "25")
-q, --query <query>Filter spans (e.g., "op:db", "duration:>100ms", "project:backend")
-s, --sort <sort>Sort order: date, duration (default: "date")
-t, --period <period>Time period (e.g., "1h", "24h", "7d", "30d") (default: "7d")
-f, --freshBypass cache, re-detect projects, and fetch fresh data
-c, --cursor <cursor>Navigate pages: "next", "prev", "first" (or raw cursor string)

sentry span view <trace-id/span-id...>

View details of specific spans

Arguments:

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

Options:

OptionDescription
--spans <spans>Span tree depth limit (number, "all" for unlimited, "no" to disable) (default: "3")
-f, --freshBypass 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 spans

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
# List spans within a specific trace
sentry span list abc123def456abc123def456abc12345
# Paginate through results
sentry span list -c next

View spans

Terminal window
# View a single span
sentry span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890
# View multiple spans at once
sentry span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890 b2c3d4e5f6789012
# With explicit org/project
sentry span view my-org/backend/abc123def456abc123def456abc12345 a1b2c3d4e5f67890