vercel traces config set adds or replaces a sampling rule
Introduced 2026-08-22 · score 0.95
HOW TO USE IT
When adding or changing one sampling rule, run `vercel traces config set <environment> <rate> [requestPath]`; use `any`, `preview`, or `production` and a whole rate from 1 to 100. The rule is matched by environment and path prefix, so repeating that pair changes its rate.
vercel traces config set <environment> <rate> [requestPath]WHY THIS HELPS
Add or change one trace sampling rule for a project.
REQUIREMENTS AND LIMITATIONS
- Version: 59.5.0
- <environment> (required): `any`, `preview`, or `production`; `any` matches every environment.
- <rate> (required): Whole percentage from 1 to 100: percentage of matching requests to trace.
- [requestPath]: Path prefix, such as `/api`; omit to match every path.
- --project <name-or-id>: Select project; defaults to the linked project.
- --json: Output the new rule as JSON.
- Prerequisite: Vercel CLI must be installed and authenticated to access resources or perform administrative tasks.
- Prerequisite: Changing sampling rules requires a role with project update access.
- Environment and rate are checked before the API call.
- Rules are identified by environment and path prefix.
- The success line reports the old rate, new rate, and rule count.
- Drain domains, ignore paths, and rules not being changed are written back untouched.
- Only the rule being written is rebuilt from the command line; editing another rule does not round a fractional rate that the API accepts but the CLI cannot express.
- An eleventh rule is refused with an error naming the ten-rule limit.
FIRST-PARTY EVIDENCE
- https://github.com/vercel/vercel/blob/main/packages/cli/CHANGELOG.md#5950
- https://vercel.com/docs/cli/traces
- https://vercel.com/docs/cli
Check the installed version and the source before using it. Entry JSON