# aspire otel traces command

## Name

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

## Synopsis

```bash title="Aspire CLI"
aspire otel traces [resource] [options]
```

<AsciinemaPlayer
  src="/casts/aspire-otel-traces.cast"
  poster="npt:0:01"
  rows={28}
  loop={false}
  speed={.5}
/>

## Description

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.

## Arguments

- **`[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).

## Options

The following options are available:

- **`--apphost <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).

- <Include relativePath="reference/cli/includes/option-help.md" />

- <Include relativePath="reference/cli/includes/option-log-level.md" />

- <Include relativePath="reference/cli/includes/option-non-interactive.md" />

- <Include relativePath="reference/cli/includes/option-nologo.md" />

- <Include relativePath="reference/cli/includes/option-banner.md" />

- <Include relativePath="reference/cli/includes/option-wait.md" />

## Examples

- View all traces:

  ```bash title="Aspire CLI"
  aspire otel traces
  ```

- View traces for a specific resource:

  ```bash title="Aspire CLI"
  aspire otel traces apiservice
  ```

- View a specific trace detail:

  ```bash title="Aspire CLI"
  aspire otel traces --trace-id abc123
  ```

- View only traces with errors:

  ```bash title="Aspire CLI"
  aspire otel traces --has-error true
  ```

- View the last 20 traces in JSON format:

  ```bash title="Aspire CLI"
  aspire otel traces --limit 20 --format Json
  ```

## See also

- [aspire otel command](../aspire-otel/)
- [aspire otel logs command](../aspire-otel-logs/)
- [aspire otel spans command](../aspire-otel-spans/)