---
title: "ezgh obs datasets sampling"
description: "Trace sampling: which traces a dataset keeps."
---

> 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 datasets sampling

{/* 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 datasets sampling <command>
```

Trace sampling keeps some of a dataset's traces and drops the rest, deciding each trace whole after its spans arrive (tail sampling): keep every error and slow trace, say, and 5% of the rest. A dataset's policy is its rules, tried in order, and a default. Sampling applies to traces only; logs and metrics are kept as they arrive, and span metrics count every span, kept or not. A dataset without a policy, or with one that isn't enabled, keeps every trace. The dataset is given by environment, ID, slug (dst\_…) or name.

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

## Flags

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

## Subcommands

| Command | Description |
| --- | --- |
| [`ezgh obs datasets sampling get`](/cli/reference/obs-datasets-sampling-get) | Show a dataset's trace sampling policy |
| [`ezgh obs datasets sampling set`](/cli/reference/obs-datasets-sampling-set) | Replace a dataset's trace sampling policy from a JSON file |
| [`ezgh obs datasets sampling stats`](/cli/reference/obs-datasets-sampling-stats) | Show how many traces a dataset's sampling received and kept |

Source: https://docs.ezghcloud.com/cli/reference/obs-datasets-sampling/index.mdx
