Skip to content
Docs Try Aspire

aspire otel traces command

aspire otel traces - View traces from the Dashboard telemetry API.

Aspire CLI
aspire otel traces [resource] [options]

The aspire otel traces command retrieves and displays distributed traces collected by the Aspire Dashboard. A trace represents a complete request as it flows through your distributed application. The command shows trace summaries including timestamp, name, span count, duration, and status.

You can view a summary of all traces, or provide a specific trace ID with --trace-id to view a detailed span tree for that trace.

  • [resource]

    Filter by resource name. When specified, only traces involving the matching resource are shown. Supports both exact instance names and base resource names (which match all replicas).

The following options are available:

  • --apphost

    The path to the Aspire AppHost project file.

  • --format <Table|Json>

    Output format (Table or Json).

  • -n, --limit <limit>

    Maximum number of items to return.

  • -t, --trace-id <trace-id>

    Filter by trace ID. When specified, displays a detailed span tree for the given trace instead of a summary list.

  • --has-error <true|false>

    Filter by error status (true to show only errors, false to exclude errors).

  • -?, -h, --help

    Prints help and usage documentation for the available commands and options.

  • -d, --debug

    Enable debug logging to the console, which prints detailed information about what Aspire CLI is doing when a command is run.

  • --wait-for-debugger

    Wait for a debugger to attach before running a command.

  • View all traces:

    Aspire CLI
    aspire otel traces
  • View traces for a specific resource:

    Aspire CLI
    aspire otel traces apiservice
  • View a specific trace detail:

    Aspire CLI
    aspire otel traces --trace-id abc123
  • View only traces with errors:

    Aspire CLI
    aspire otel traces --has-error true
  • View the last 20 traces in JSON format:

    Aspire CLI
    aspire otel traces --limit 20 --format Json