aspire otel spans command
aspire otel spans - View spans from the Dashboard telemetry API.
Synopsis
Section titled “Synopsis”aspire otel spans [resource] [options]Description
Section titled “Description”The aspire otel spans command retrieves and displays distributed trace spans collected by the Aspire Dashboard. Spans represent individual units of work within a distributed trace, such as HTTP requests or database calls. You can filter spans by resource name, trace ID, or error status. Use --follow to stream spans in real-time as they arrive.
Arguments
Section titled “Arguments”-
[resource]Filter by resource name. When specified, only spans from the matching resource are shown. Supports both exact instance names and base resource names (which match all replicas).
Options
Section titled “Options”The following options are available:
-
--apphostThe path to the Aspire AppHost project file.
-
-f, --followStream telemetry in real-time as it arrives.
-
--format <Table|Json>Output format (Table or Json).
-
-n, --limit <limit>Maximum number of items to return.
-
--trace-id <trace-id>Filter by trace ID.
-
--has-error <true|false>Filter by error status (true to show only errors, false to exclude errors).
-
-?, -h, --helpPrints help and usage documentation for the available commands and options.
-
-d, --debugEnable debug logging to the console, which prints detailed information about what Aspire CLI is doing when a command is run.
-
--wait-for-debuggerWait for a debugger to attach before running a command.
Examples
Section titled “Examples”-
View all spans:
Aspire CLI aspire otel spans -
View spans for a specific resource:
Aspire CLI aspire otel spans apiservice -
Stream spans in real-time:
Aspire CLI aspire otel spans --follow -
View only error spans:
Aspire CLI aspire otel spans --has-error true -
View spans for a specific trace in JSON format:
Aspire CLI aspire otel spans --trace-id abc123 --format Json