samples or traces commands (aliases) to fetch individual samples from AppSignal’s tracing data. Traces show what happened during a request, job, or script run, and they can show the trace behind an exception.
List traces, then open one to view its span tree and inspect a single span’s timings, tags, and attributes.
The command is available as samples or traces. appsignal-cli traces list and appsignal-cli samples list do the same thing. This page uses traces throughout.
Traces are retrieved through AppSignal’s REST tracing API using your signed-in account, so authenticate the CLI first. See Authentication.
Common options
Everytraces command identifies one application, and uses your default organization unless you tell it otherwise:
| Flag | Description |
|---|---|
--app <name> | Application name (add --environment when more than one app shares the name) |
--environment <env> | Environment, used with --app, such as production or development |
--app-id <id> | The app’s ID (a long hexadecimal string from appsignal-cli apps list), instead of --app and --environment |
--org <slug> | Organization slug (uses your default if omitted) |
Find a trace from an incident
Most investigations start from an incident, not a trace ID. These steps take you from an incident number to a single request’s span tree, following a LaravelPaymentDeclinedException on POST /checkout (exception incident 9).
1. Read the incident’s digest
Error traces are grouped by an exception digest. Read the digest from the incident, or copy it from the AppSignal app:Shell
digests field:
2. List the traces for that digest
Pass the digest totraces errors. Each row is one captured occurrence:
Shell
3. Inspect the trace
Pass the incident number and trace ID totraces show-incident:
Shell
!! marks the span that raised the exception: here, POST /checkout right after the 334 ms stripe.charge. To inspect one span in full, add --span-id with the value from its span:. See inspect a single span.
These steps start from an exception incident. If you are starting from something else, use the matching command:
- A performance incident:
traces incident --number <N>lists its traces without a digest. See for an incident. - A known namespace and action:
traces list --namespace <name> --action <name>. See for an action.
List traces
Three commands list traces, depending on what you start from: a performance action, an incident, or an exception digest. Each returns a table of trace IDs you can then pass to the inspect commands in the following section.For an action
List the recent performance samples for one namespace and action:Shell
list requires --namespace, --action, and an app (--app or --app-id), and takes these extra options:
| Flag | Description |
|---|---|
--namespace <name> | Namespace to search in, e.g. web, background, graphql (required) |
--action <name> | Action to fetch traces for, e.g. GET /products (required) |
--start <ISO8601> | Start time, e.g. 2025-01-15T00:00:00Z (defaults to 24 hours ago) |
--end <ISO8601> | End time (defaults to now) |
--min-duration-ms <ms> | Only return traces at least this many milliseconds long |
--limit <N> | Maximum traces to return (1–100, default 25) |
--page-all | Fetch every trace in the range, ignoring --limit |
--namespace is the AppSignal namespace that groups the action, commonly web, background, rake, runner, or graphql. Your app may also define custom namespaces. If you are not sure which namespace an action belongs to, use traces incident --number <N> instead: it reads the namespace and action names straight from the performance incident, so you do not have to supply them yourself.For an incident
Skip the namespace and action lookup and list the samples behind a performance incident by its number:Shell
--action to restrict the lookup to one of them. On top of the common options, incident takes:
| Flag | Description |
|---|---|
--number <N> | Performance incident number (required) |
--action <name> | Restrict the lookup to one action when the incident has several |
--start <ISO8601> | Start time (defaults to 24 hours ago) |
--end <ISO8601> | End time (defaults to now) |
--min-duration-ms <ms> | Only return traces at least this many milliseconds long |
--limit <N> | Maximum traces per action (1–100, default 25) |
--page-all | Fetch every trace for each action, ignoring --limit |
Error traces for an exception
List the error traces behind an exception, identified by its digest:Shell
errors requires --digest and an app (--app or --app-id), and also takes --limit (1–100, default 25) and --page-all. Find the digest on the exception incident in the AppSignal app UI, or use traces show-incident in the following section to skip the digest entirely.
Inspect a trace
Once you have a trace ID, open it to see the span tree: each span with its kind, duration, event count, and any exception, followed by a summary. Three commands do this, matching the three ways you listed the trace.From an action
Show a performance trace by its namespace, action, and trace ID:Shell
!! and the exception type.
From an exception digest
Show an error trace by its digest and trace ID:Shell
traces errors (or by traces incident for an exception incident).
From an incident number
When you have an incident number rather than a namespace, action, or digest,show-incident checks the incident for you: from the number it looks up the namespace and action (or digest) so you do not have to supply them. You still choose which trace to inspect with --trace-id, so list the incident’s traces first with traces incident:
Shell
Inspect a single span
Add--span-id to any of the show commands to print one span’s full detail instead of the tree: its timings, status, tags, span attributes, events, and resource attributes.
Shell
span: value at the end of each line in the span tree. If the ID isn’t in the trace, the CLI lists what’s available:
Sensitive data
By default, the show commands omit HTTP headers, request parameters, session data, and function parameters. Add--include-sensitive to show them:
Shell
Time range and pagination
list, incident, and the performance show commands look back 24 hours by default. Widen or move the window with --start and --end (ISO 8601, for example 2025-01-15T00:00:00Z). If a trace is older than the default window, a lookup by ID reports that it wasn’t found: rerun with an earlier --start.
--limit restricts a listing to at most 100 traces (25 by default). To fetch every trace in the range instead, use --page-all, which ignores --limit.
JSON output
- Add the global
--output json(or--format json) flag for machine-readable results. - List commands (
traces list,traces incident,traces errors) return atracesarray. - Show commands (
traces show,traces show-error,traces show-incident) return thetrace_idand itsspans, plus a singlespanwhen you pass--span-id. - This applies to both performance samples and error traces, and combines with
--page-allto page through every result. - Results (the JSON) are written to stdout while status messages are written to stderr, so piping the output to another tool never mixes in non-JSON text.
Shell