---
title: "ezgh obs traces search"
description: "Search a dataset's spans, newest first."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh obs traces search

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh obs traces search [flags]
```

Search the spans of a dataset (an environment) by service, span name, kind, status, duration, trace ID and attributes. Without `--from`, the last hour. Times are RFC 3339, a date, or a duration ago (2h, 7d). `--attr` key=value matches a span attribute; `--attr` key only needs it set; `--resource-attr` does the same for resource attributes.

Part of [`ezgh obs traces`](/cli/reference/obs-traces).

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--all` | boolean |  | follow nextCursor through every page |
| `--application` | string, repeatable |  | ezgh.metadata.application (repeatable) |
| `--attr` | string, repeatable |  | span attribute key=value, or key to require it (repeatable) |
| `--cursor` | string |  | start from this page (a previous page's nextCursor) |
| `--dataset` | string |  | the dataset: its ID, slug or environment (required) |
| `--from` | string |  | start of the time range (default 1h ago) |
| `--kind` | string, repeatable |  | span kind: unspecified, internal, server, client, producer, consumer (repeatable) |
| `--limit` | int | `50` | items per page, 1 to 100 |
| `--max-duration` | string |  | at most this long |
| `--min-duration` | string |  | at least this long (250ms, 2s) |
| `--name` | string, repeatable |  | span name (repeatable) |
| `--resource-attr` | string, repeatable |  | resource attribute key=value, or key (repeatable) |
| `--root` | boolean |  | only root spans (one per trace) |
| `--service` | string, repeatable |  | service.name (repeatable) |
| `--status` | string, repeatable |  | status: unset, ok or error (repeatable) |
| `--to` | string |  | end of the time range (default now) |
| `--trace-id` | string |  | only this trace's spans |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/obs-traces-search/index.mdx
