Dry-run a custom metric definition
Run a candidate predicate against recent stored traces without saving it, and see what it would have recorded.
Definitions are not retroactive, so a saved predicate that matches nothing looks identical to one that matches nothing yet. This answers that before you commit: which spans matched, what values they'd contribute, and how many distinct labels the metric would carry.
Samples the newest runs (20 by default, 50 max) — enough to tell a working predicate from a broken one, not a measurement of the true rate. Pass workforce_id to make the sample representative of the agent you're actually matching. This is the only endpoint that reads stored traces, which is why it is capped; do not poll it.
Because it returns trace content, project_id doubles as the permission target: omit it and the sample spans the whole org, which needs alarms.manage; set it and the sample is capped to that project, which needs projects.alarms.manage there. A caller scoped to one project must therefore pass it.
Path parameters
Request body
Response
What the definition would record