# Chalk CLI Reference: Traces
source: https://docs.chalk.ai/cli#traces

Inspect distributed traces to debug and understand query execution. View detailed timing and dependency information for feature computations.

## `chalk trace get`
source: https://docs.chalk.ai/cli?command=trace_get

```bash
chalk trace get
```

Retrieve a distributed trace from Chalk.

A trace represents the complete execution path of a request through the Chalk system, showing all operations and their timing information.

**Flags**

- `--operation-id <operation-id>` (string)
  Operation ID to retrieve the trace for.
- `--trace-id <trace-id>` (string)
  Trace ID to retrieve the trace for.

**Example**

```
$ chalk trace get --operation-id abc123
$ chalk trace get --operation-id "my-operation-id"
```

## `chalk trace list`
source: https://docs.chalk.ai/cli?command=trace_list

```bash
chalk trace list
```

List distributed traces from Chalk with optional filtering.

You can filter traces by time range, service name, and span name. By default, this command returns traces from the last hour. Use --all-pages to fetch all available results.

**Flags**

- `--start-time <start-time>` (string)
  Start time for trace filtering (e.g., `'2024-01-01T00:00:00Z'` or relative like `'24h'`).
- `--end-time <end-time>` (string)
  End time for trace filtering (e.g., `'2024-01-01T23:59:59Z'`).
- `--service-name <service-name>` (string)
  Filter traces by service name.
- `--span-name <span-name>` (string)
  Filter traces by span name (operation name).
- `--limit <limit>` (int, default `100`)
  Maximum number of traces to return per page (default: 100, max: 1000).
- `--all-pages <all-pages>` (bool, default `false`)
  Fetch all pages of results (by default only the first page is returned).

**Example**

```
$ chalk trace list
$ chalk trace list --start-time 24h
$ chalk trace list --service-name my-service --span-name my-operation
$ chalk trace list --start-time "2024-01-01T00:00:00Z" --end-time "2024-01-01T23:59:59Z"
$ chalk trace list --limit 50 --all-pages
```

## `chalk trace span`
source: https://docs.chalk.ai/cli?command=trace_span

```bash
chalk trace span
```

Commands for working with individual spans in traces

## `chalk trace span list`
source: https://docs.chalk.ai/cli?command=trace_span_list

```bash
chalk trace span list
```

List spans from Chalk with optional filtering.

You can filter spans by time range, trace ID, parent span ID, operation name, service name, status code, and duration. By default, this command returns spans from the last hour. Use --all-pages to fetch all available results.

**Flags**

- `--trace-id <trace-id>` (string)
  Filter spans by trace ID.
- `--start-time <start-time>` (string)
  Start time for span filtering (e.g., `'2024-01-01T00:00:00Z'` or relative like `'24h'`).
- `--end-time <end-time>` (string)
  End time for span filtering (e.g., `'2024-01-01T23:59:59Z'`).
- `--limit <limit>` (int, default `100`)
  Maximum number of spans to return per page (default: 100, max: 1000).
- `--all-pages <all-pages>` (bool, default `false`)
  Fetch all pages of results (by default only the first page is returned).
- `--parent-span-id <parent-span-id>` (string)
  Filter by parent span ID (only return children of this span).
- `--operation-name <operation-name>` (string)
  Filter by operation name.
- `--service-name <service-name>` (string)
  Filter by service name.
- `--status-code <status-code>` (string)
  Filter by status code (OK, ERROR).
- `--min-duration <min-duration>` (string)
  Filter by minimum duration (e.g., `'100us'`, `'10ms'`, `'1s'`).
- `--max-duration <max-duration>` (string)
  Filter by maximum duration (e.g., `'100us'`, `'10ms'`, `'1s'`).

**Example**

```
$ chalk trace span list
$ chalk trace span list --start-time 24h
$ chalk trace span list --trace-id abc123
$ chalk trace span list --operation-name my-operation --service-name my-service
$ chalk trace span list --parent-span-id xyz789
$ chalk trace span list --status-code ERROR
$ chalk trace span list --min-duration 100ms --max-duration 5s
$ chalk trace span list --limit 50 --all-pages
```
