Skip to main content
POST
Create an Auto Monitor Setup
An auto monitor setup is an asynchronous process that attempts to create a Traceloop monitor based on the selector you provide. The selector is matched against your incoming spans — when a match is found, the monitor is created and the specified evaluators begin running on those spans.
All API requests require authentication. Pass your API key as a Bearer token in the Authorization header. See Authentication for details.

Request Body

string
required
Unique identifier for the auto monitor setup. Used to reference it in future requests (get, update, delete).Example: "my-agent-monitor-1"
string[]
List of evaluator slugs to run on matched spans.Example: ["answer-relevancy", "toxicity-detector"]See the full list of available slugs in the Evaluator Slugs reference.
Either evaluators or evaluator_configs must be provided on create. If both are provided, evaluator_configs wins and this field is ignored. Use evaluator_configs when you need to pin a per-evaluator scope.
object[]
List of per-evaluator configurations. Use this instead of evaluators when you need to control the granularity at which an individual evaluator runs.Each entry has the following fields:Example:
object[]
An array of filter rules used to match spans. Each rule specifies an attribute key, a value to match, and a source indicating where the attribute lives. Only spans matching all provided rules will be evaluated.Each rule has the following fields:All available span and resource attributes can be found in your Traceloop traces page.

Example Request

Using the simple evaluators array (no per-evaluator scope):
Using evaluator_configs to pin a scope per evaluator:

Response

201 Created

Returns the created auto monitor setup object. The init_rules array reflects the stored selector — same shape as the input selector. Each entry in evaluators optionally includes a scope field (session, trace, or span) when a scope was set for that evaluator via evaluator_configs. When no scope was provided at create time, scope is omitted from the evaluator object (it is never returned as null). The status field indicates the current state of the setup process:

400 Bad Request

Returned when the request body is invalid. Common validation errors:
  • Neither evaluators nor evaluator_configs is set on a Create request — one of evaluators or evaluator_configs is required.
  • An entry in evaluator_configs is missing its slug.
  • An entry in evaluator_configs has a scope that is not one of session, trace, or span.
  • A provided evaluator slug is not recognized — unknown evaluator slug "<slug>".

500 Internal Server Error