> ## Documentation Index
> Fetch the complete documentation index at: https://arize-ax.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Traces

> List traces within a project, filtered by time range and a filter DSL, using the Arize Go SDK.

<Note>
  The `traces` client methods are currently in **BETA**. The API may change without notice. A one-time warning is emitted on first use.
</Note>

A trace is the full execution of an LLM application request — a tree of hierarchical spans sharing a trace ID. The `Traces` subclient queries traces within a project, filtered by time range and an optional filter DSL. `Project` accepts a name or ID; when a name is passed, `Space` (name or ID) is required so the SDK can resolve the name to a unique ID.

## List Traces

`List` returns a paginated list of traces matching the given filter. Like `spans.List`, `traces.List` uses `POST` because the filter DSL can be too large for a query string, so the body fields (project, time range, filter) and the query params (limit, cursor) are flattened into a single `ListRequest`. A trace is returned when any of its spans matches the filter; each trace carries a flat list of spans, so reconstruct the trace tree client-side using each span's `parent_id`.

**Signature:**

```go theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
func (c *Client) List(ctx context.Context, req ListRequest) (*ListTraces, error)
```

**Usage Example:**

```go theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
package main

import (
    "context"
    "errors"
    "fmt"
    "log"
    "time"

    "github.com/Arize-ai/client-go-v2/arize"
    "github.com/Arize-ai/client-go-v2/arize/traces"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        log.Fatal(err)
    }

    resp, err := client.Traces.List(
        context.Background(),
        traces.ListRequest{
            Project: "your-project-name-or-id",
            Space:   "your-space-name-or-id",
            Start:   time.Now().Add(-24 * time.Hour),
            End:     time.Now(),
            Filter:  "status_code = 'ERROR'",
            Limit:   50,
        },
    )
    if err != nil {
        var unauthorized *arize.UnauthorizedError
        if errors.As(err, &unauthorized) {
            log.Fatalf("unauthorized: %v", unauthorized)
        }
        log.Fatal(err)
    }

    for _, trace := range resp.Traces {
        fmt.Printf("trace %s (root=%s, %d spans)\n",
            trace.TraceId,
            trace.RootSpanId,
            len(trace.Spans),
        )
    }
}
```
