trace
View distributed traces
Commands
Section titled “Commands”sentry trace list [<org/project>]
Section titled “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: "25") |
-q, --query <query> |
Search query (Sentry search syntax) |
-s, --sort <sort> |
Sort by: 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:
# List recent tracessentry trace list
# Show more tracessentry trace list --limit 50
# Sort by slowest firstsentry trace list --sort duration
# Filter by transaction name in the last 24 hourssentry trace list -q "transaction:GET /api/users" --period 24h
# Fetch the next pagesentry trace list my-org/backend -c next
# Find a project across organizationssentry trace list backendsentry trace view <org/project/trace-id...>
Section titled “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 |
--full |
Fetch full span attributes (auto-enabled with --json) |
--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 trace details with the span treesentry trace view abc123def456abc123def456abc12345
# Show the full trace across all projectssentry trace view my-org/abc123def456abc123def456abc12345
# Filter the span tree to one projectsentry trace view my-org/cli-server/abc123def456abc123def456abc12345
# Recover the trace from an issue short IDsentry trace view PROJ-123
# Open the trace in the browsersentry trace view abc123def456abc123def456abc12345 -w
# Find a project across organizationssentry trace view cli-server abc123def456abc123def456abc12345
# Select the trace ID and an attribute across the whole span treesentry trace view abc123def456abc123def456abc12345 --json --fields traceId,http.method
# Keep full spans while requesting an additional attributesentry trace view abc123def456abc123def456abc12345 --json --fields spans,http.method
# Select IDs and detail attributes from root spans onlysentry trace view abc123def456abc123def456abc12345 --json --fields spans.span_id,spans.data.http.method
# Select an additional attribute from immediate child spanssentry trace view abc123def456abc123def456abc12345 --json --fields spans.children.additional_attributes.http.methodsentry trace logs <org/project/trace-id...>
Section titled “sentry trace logs <org/project/trace-id...>”View logs associated with a trace
Arguments:
| Argument | Description |
|---|---|
<org/project/trace-id...> |
[<org>/[<project>/]]<trace-id> - Optional org/project and required trace ID |
Options:
| Option | Description |
|---|---|
-w, --web |
Open trace in browser |
-t, --period <period> |
Time range: "7d", "2024-01-01..2024-02-01", ">=2024-01-01" (default: "14d") |
-n, --limit <limit> |
Number of log entries (<=1000) (default: "100") |
-q, --query <query> |
Filter query (e.g., "severity:error", "project:backend", "project:[a,b]") |
-s, --sort <sort> |
Sort order: "newest" (default) or "oldest" (default: "newest") |
-f, --fresh |
Bypass cache, re-detect projects, and fetch fresh data |
Examples:
# View logs for a tracesentry trace logs abc123def456abc123def456abc12345
# Filter trace logs to one projectsentry trace logs my-org/cli-server/abc123def456abc123def456abc12345
# Filter trace logs to several projectssentry trace logs abc123def456abc123def456abc12345 -q "project:[cli-server,api]"
# Search with a longer time windowsentry trace logs --period 30d abc123def456abc123def456abc12345
# Only error logssentry trace logs -q 'severity:error' abc123def456abc123def456abc12345
# Output as JSONsentry trace logs --json abc123def456abc123def456abc12345
# Logs for a trace in an explicit organizationsentry trace logs my-org/abc123def456abc123def456abc12345All commands support --json for machine-readable output and --fields to select specific JSON fields.
With trace view --json --fields, summary fields such as traceId and
duration select trace metadata. Bare attribute names such as http.method
request that attribute on every span and return it under each span's
additional_attributes. The output retains span_id and children so that
attributes on nested spans stay connected to the trace. Include summary fields
explicitly when you need them.
Selecting spans keeps the full span tree, including any requested attributes.
Paths starting with spans. select the corresponding JSON structure. They do
not implicitly recurse into children; include children in the path to
select that level. Attribute names keep their literal dots in the output.
To request an attribute whose name starts with spans., use its full path,
such as spans.additional_attributes.spans.foo.