Agent monitors (GraphQL)

Related queries and mutations in Agent traces and evaluations. Each has its own section.

Queries

evaluateAgentMonitorDataSource (query)

evaluateAgentMonitorDataSource is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Get agent span/trace schema from base trace table

Arguments

ArgumentTypeDescription
mconString!MCON to evaluate
connectionIdUUIDConnection UUID
transforms[TransformInput!]Transforms to apply to the data source
filtersFilterGroupInputStructured SQL filtering conditions to apply to query
agentSpanFilters[AgentSpanFilterInput!]Filter by agent span fields (agent, workflow, task, span_name)
isAgentTraceAggregationBooleanIf true, evaluate schema for trace-level aggregation mode
isAgentConversationAggregationBooleanIf true, evaluate schema for conversation-level aggregation mode (accepts conversation-grain eval templates).
clusteringSpaceUuidUUIDConversation clustering space whose membership filters or segments the evaluated data source, mirroring the monitor's cluster reference. Requires isAgentConversationAggregation.
clusterKeys[String!]Clusters to filter to (any-of) within clusteringSpaceUuid. Omit when segmenting by cluster_key via segments.
segments[FilterValueUnionInput!]Segment fields matching the monitor's segments input. Including 'cluster_key' together with clusteringSpaceUuid evaluates the segmented shape, exposing a cluster_key column on the returned schema.

Returns

DataSourceEvaluationResult

Example

query EvaluateAgentMonitorDataSource($mcon: String!) {
  evaluateAgentMonitorDataSource(mcon: $mcon) {
    connectionUuid
    warehouseUuid
    mcons
    rowCount
    unresolvedMcons
    whereCondition
  }
}

Related types

AgentSpanFilterInput, DataSourceEvaluationResult, FilterGroupInput, FilterValueUnionInput, TransformInput, UUID

getAgentConversationSampleV2 (query)

getAgentConversationSampleV2 is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Sample conversation-grain agent data: one row per conversation (packed transcript + conversation-level columns). When conversation eval transforms are supplied, each conversation is scored by them; when omitted, the raw conversation rows are returned without scoring.

Arguments

ArgumentTypeDescription
mconString!MCON of the table with agent observability traces
agentSpanFilters[AgentSpanFilterInput!]!Filter by agent span fields. Conversation eval monitors require exactly one agent filter (agent, optionally scoped to a workflow).
filtersFilterGroupInputConversation-level filtering conditions (turn_count, duration_seconds, status).
transforms[TransformInput!]Conversation eval transforms used to score each sampled conversation. Omit to fetch the raw conversation rows without any LLM scoring.
limitIntNumber of sample conversations to return (1–100) Default: 10.
offsetIntNumber of conversations to skip before returning results (min 0) Default: 0.
connectionIdUUIDConnection UUID
ingestionStartTimeDateTimeFilter by conversation turn start time (inclusive)
ingestionEndTimeDateTimeExclusive upper bound on conversation turn time
collectionLagHoursIntOptional completeness settle, in hours: conversations whose last turn is newer than this are held back as still in progress. Opt-in — defaults to 0 (no settle) so the preview surfaces the newest conversations; set it to mirror a saved monitor's collection_lag. Applies only when no explicit time range is given; an explicit range is treated as authoritative. Default: 0.
includeToolCallsBooleanWhen true, the sample also returns a conversationWithToolCalls column: the transcript with tool call inputs, outputs, and errors interleaved between the turns that triggered them. Also implied when any supplied transform reads tool calls: its includeToolCalls is true, or it is unset and its template reads tool calls by default (as groundedness_conversation does). False or omitted otherwise returns the plain transcript. Default: false.
clusteringSpaceUuidUUIDConversation clustering space whose membership filters or segments the sample, mirroring the monitor's cluster reference. Membership is resolved best-effort — a sample taken during classification lag can differ from the eventual datapoint.
clusterKeys[String!]Clusters to filter the sample to (any-of) within clusteringSpaceUuid. Omit when segmenting by cluster_key via segments.
segments[FilterValueUnionInput!]Segment fields matching the monitor's segments input. Including 'cluster_key' together with clusteringSpaceUuid previews the segmented shape: one row per (conversation, cluster) with a cluster_key column.

Returns

SQLResponse

Example

query GetAgentConversationSampleV2($mcon: String!, $agentSpanFilters: [AgentSpanFilterInput!]!) {
  getAgentConversationSampleV2(mcon: $mcon, agentSpanFilters: $agentSpanFilters) {
    columns
    rows
    hasCustomSqlFilter
    query
    hasError
    error
    samplingDisabled
    samplingRestricted
    contentWithheldReason
    rateLimitExceeded
    idempotentStatus
    downloadUrl
    queryExecutionId
  }
}

Related types

AgentSpanFilterInput, DateTime, FilterGroupInput, FilterValueUnionInput, SQLResponse, TransformInput, UUID

getAgentEvaluationRunSamples (query)

getAgentEvaluationRunSamples is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Fetch exact stored evaluated rows for an AgentEvaluation monitor run.

Arguments

ArgumentTypeDescription
inputAgentEvaluationRunSamplesInput!

Returns

AgentEvaluationRunSamplesResult

Example

query GetAgentEvaluationRunSamples($input: AgentEvaluationRunSamplesInput!) {
  getAgentEvaluationRunSamples(input: $input) {
    status
    message
    unsupportedReason
    totalCount
    hasMore
    contentWithheldReason
  }
}

Types used only by getAgentEvaluationRunSamples

AgentEvaluationRunSampleRow

Object type.

FieldTypeDescription
scoreFloatStored evaluation score for the requested metric
metricNameStringEvaluation score field name
conversationIdStringConversation identifier, when available
traceIdStringTrace identifier, when available
spanIdStringSpan identifier, when available
explanationStringStored judge reasoning; null when unavailable.
inputPreviewStringInput/prompt preview, when available
outputPreviewStringOutput/completion preview, when available
promptPreviewStringPrompt preview, when available
evaluatedAtDateTimeEvaluation/run timestamp when available
startedAtDateTimeWhen the evaluated trace (span evaluations) or conversation (conversation evaluations) started; null when unknown
AgentEvaluationRunSamplesInput

Input object type.

FieldTypeDescription
monitorUuidUUID!Agent evaluation monitor UUID
jobExecutionUuidUUID!Monitor run UUID from the metric datapoint that produced this run. Metric datapoints may carry a consolidating job UUID; direct job execution UUIDs are also accepted.
metricNameStringEvaluation score field to fetch, usually the chart datapoint field/metric name. Required when the run contains multiple evaluation score fields.
limitIntNumber of rows to return (max 100) Default: 10.
offsetIntNumber of stored evaluation rows to skip Default: 0.
includeExplanationBooleanInclude the stored judge explanation when available; explanation is null when unavailable. Default: true.
sortDirectionAgentEvaluationSampleSortDirectionScore sort direction. Defaults to ASC (lowest scores first, worst-first for 1-5 quality evals). Pass DESC to return the highest-scoring rows first — the breaching side for boolean evaluations that alert on a count or rate of true. Default: "ASC".
AgentEvaluationRunSamplesResult

Object type.

FieldTypeDescription
statusAgentEvaluationRunSamplesStatus!
messageStringHuman-readable unsupported/unavailable reason
unsupportedReasonAgentEvaluationRunSamplesUnsupportedReasonStructured reason when status is UNSUPPORTED; null for supported or temporarily unavailable samples.
rows[AgentEvaluationRunSampleRow!]!Exact stored evaluated rows for this monitor run
totalCountIntTotal row count when cheaply available
hasMoreBoolean!Whether another page is available
contentWithheldReasonRawContentWithheldReasonWhy the judge's explanation was withheld, or null when it was not. Rows still carry scores and timestamps either way, so an absent explanation alone cannot say whether none was stored or the caller may not read it. Only NO_CONTENT_PERMISSION is fixed by a role grant.
AgentEvaluationRunSamplesStatus

Enum type.

ValueDescription
OK
UNSUPPORTED
UNAVAILABLE
AgentEvaluationRunSamplesUnsupportedReason

Enum type. Classify why exact samples cannot be produced for a run.

ValueDescription
NON_AGENT_EVALUATION_MONITOR
TRACE_AGGREGATION
NON_CLICKHOUSE_SPAN_EVALUATION
UNSUPPORTED_SCORE_OUTPUT_TYPE
AgentEvaluationSampleSortDirection

Enum type. Score sort direction for evaluation run samples.

ValueDescription
ASC
DESC

Related types

DateTime, RawContentWithheldReason, UUID

getAgentSpanGroups (query)

getAgentSpanGroups is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Retrieve agent log groups with observability data

Arguments

ArgumentTypeDescription
mconString!MCON of the table with agent observability traces
traceModeBooleanRequire traceIds to be supplied, rejecting the request when it is not. It has no other effect: it does not change which spans are returned, or the order they come back in. Default: false.
traceIds[String!]Filter by specific trace IDs
traceTimestampDateTimeFilter by trace timestamp (inclusive) +- 1 hr
startTimeDateTimeFilter by span start time (inclusive)
endTimeDateTimeFilter by span end time (inclusive)

Returns

AgentSpanTree

Example

query GetAgentSpanGroups($mcon: String!) {
  getAgentSpanGroups(mcon: $mcon) {
    nodes {
      nodeName
      nodeValue
      level
      count
      isLeaf
      isToolCall
      containerSpanName
      multiParent
    }
  }
}

Types used only by getAgentSpanGroups

AgentSpanNode

Object type.

FieldTypeDescription
nodeNameString!
nodeValueString
childNodes[AgentSpanNode!]!
levelInt!
countInt!
isLeafBoolean!
isToolCallBoolean!
containerSpanNameString
multiParentBoolean!
AgentSpanTree

Object type.

FieldTypeDescription
nodes[AgentSpanNode!]!

Related types

DateTime

getAgentSpanSample (query)

getAgentSpanSample is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Sample agent span data with optional transforms and filtering

Arguments

ArgumentTypeDescription
mconString!MCON of the table with agent observability traces
agentSpanFilters[AgentSpanFilterInput!]Filter by agent span fields (agent, workflow, task, span_name)
filtersFilterGroupInputStructured SQL filtering conditions to apply to query
transforms[TransformInput!]Transforms to apply to the data source
evaluationModeBooleanReturn evaluation test columns only (prompts, completions, span_id, transform outputs) Default: false.
traceModeBooleanRequire traceIds to be supplied, rejecting the request when it is not. It has no other effect: it does not change which spans are returned, or the order they come back in. Default: false.
limitIntNumber of sample rows to return (1–100) Default: 10.
offsetIntNumber of rows to skip before returning results (min 0) Default: 0.
spanIds[String!]Filter by specific span IDs (<= limit)
traceIds[String!]Filter by specific trace IDs (<= limit)
connectionIdUUIDConnection UUID
traceTimestampDateTimeFilter by trace timestamp (inclusive) +- 1 hr

Returns

SQLResponse

Example

query GetAgentSpanSample($mcon: String!) {
  getAgentSpanSample(mcon: $mcon) {
    columns
    rows
    hasCustomSqlFilter
    query
    hasError
    error
    samplingDisabled
    samplingRestricted
    contentWithheldReason
    rateLimitExceeded
    idempotentStatus
    downloadUrl
    queryExecutionId
  }
}

Related types

AgentSpanFilterInput, DateTime, FilterGroupInput, SQLResponse, TransformInput, UUID

getAgentSpanSampleV2 (query)

getAgentSpanSampleV2 is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Sample agent span data with optional transforms and filtering

Arguments

ArgumentTypeDescription
mconString!MCON of the table with agent observability traces
agentSpanFilters[AgentSpanFilterInput!]Filter by agent span fields (agent, workflow, task, span_name)
attributeFilters[SpanAttributeFilterInput!]Filter spans by attribute key-value pairs from attr_map column
filtersFilterGroupInputStructured SQL filtering conditions to apply to query
transforms[TransformInput!]Transforms to apply to the data source
limitIntNumber of sample rows to return (1–100) Default: 10.
offsetIntNumber of rows to skip before returning results (min 0) Default: 0.
spanIds[String!]Filter by specific span IDs (<= limit)
traceIds[String!]Filter by specific trace IDs (<= limit)
connectionIdUUIDConnection UUID
traceTimestampDateTimeFilter by trace timestamp (inclusive) +- 1 hr
ingestionStartTimeDateTimeFilter by span start time (inclusive)
ingestionEndTimeDateTimeFilter by span end time
selectExpressionTypeAgentMonitorSelectExpressionTypeThis is to explicitly specify the type of select expressions. But we will return the columns based on the validity of the query.Not providing the select_expression_type will default to SPAN_TREE. Default: "SPAN_TREE".

Returns

SQLResponse

Example

query GetAgentSpanSampleV2($mcon: String!) {
  getAgentSpanSampleV2(mcon: $mcon) {
    columns
    rows
    hasCustomSqlFilter
    query
    hasError
    error
    samplingDisabled
    samplingRestricted
    contentWithheldReason
    rateLimitExceeded
    idempotentStatus
    downloadUrl
    queryExecutionId
  }
}

Types used only by getAgentSpanSampleV2

AgentMonitorSelectExpressionType

Enum type.

ValueDescription
ALL
ATTR_MAP_KEYS
COUNT
EVALUATION
SPAN_TREE
SPAN_VIEW
SPAN_EXPORT_VIEW
TRACE_IDS
SpanAttributeFilterInput

Input object type.

FieldTypeDescription
keyString!
valueString!

Related types

AgentSpanFilterInput, DateTime, FilterGroupInput, SQLResponse, TransformInput, UUID

getTraceTreeNodes (query)

getTraceTreeNodes is a query in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Retrieve span tree for a given traceId

Arguments

ArgumentTypeDescription
mconString!MCON of the table with agent observability traces
traceIdString!Trace ID to retrieve
traceStartTimeDateTimeStart time of the trace (inclusive). When both bounds are omitted the server resolves them from the trace itself; providing exactly one bound scans a one-day window anchored to it.
traceEndTimeDateTimeEnd time of the trace (inclusive). Same omitted/single-bound behavior as traceStartTime.
agentNameStringAgent the trace belongs to. Lets a user who can access that agent, but not its whole trace table, read the trace. The request fails when the trace contains spans of an agent the user cannot access.

Returns

[TraceNode!]

Example

query GetTraceTreeNodes($mcon: String!, $traceId: String!) {
  getTraceTreeNodes(mcon: $mcon, traceId: $traceId) {
    nodeName
    spanId
    traceId
    nodeId
    parentSpanId
    duration
    startTime
    endTime
    ingestTime
    hasPrompts
    hasCompletions
    promptTokens
    completionTokens
    totalTokens
    model
    agentName
    conversationId
    workflow
    task
    childSpanIds
  }
}

Types used only by getTraceTreeNodes

TraceNode

Object type.

FieldTypeDescription
nodeNameString!
spanIdString!
traceIdString!
nodeIdString!
parentSpanIdString
durationInt!
startTimeDateTime
endTimeDateTime
ingestTimeDateTime
hasPromptsBoolean!
hasCompletionsBoolean!
promptTokensInt
completionTokensInt
totalTokensInt
modelString
agentNameString
conversationIdString
workflowString
taskString
childSpanIds[String!]!
childNodeIds[String!]!
startExtraNsInt
endExtraNsInt
statusInt
isToolCallBoolean
isLlmCallBoolean
durationBasisUnmeasuredDurationBasis
hasErrorBoolean!
UnmeasuredDurationBasis

Enum type. Why a span's duration is not a measurement. null means measured.

ValueDescription
INHERITED
APPORTIONED
UNKNOWN

Related types

DateTime

Mutations

createOrUpdateAgentEvaluationMonitor (mutation)

createOrUpdateAgentEvaluationMonitor is a mutation in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Create or update an Agent Evaluation monitor

Arguments

ArgumentTypeDescription
agentSpanFilters[AgentSpanFilterInput!]!Filter by agent span fields (agent, workflow, task, span_name)
aggregateByMonitorAggTimeIntervalAggregation time interval. When not using a hourly interval, the timecomponent of the event timestamp should be ignored. Default: "HOUR".
alertConditions[MetricAlertConditionInput!]!Alert conditions.
alertGroupingAlertGroupingInputPer-monitor alert grouping configuration. Omit or pass null for legacy per-type grouping; a non-null value enables monitor-based alert grouping. The createOrUpdate* mutations are full-state: omitting this field on an update clears any existing configuration (same as samplingConfig).
audienceConditions[AudienceConditionInput!]Narrows individual audiences to the triage priorities that reach them. Always a full replace: omitting the argument (or passing null) makes every audience unconditional, the same as passing an empty list; a non-empty list replaces the conditions wholesale. Every audience named here must also appear in this mutation's audience list (audiences, or labels on the mutations that spell it that way), which stays the monitor's full audience set — a condition narrows when one of them is notified, it does not add one.
audiences[String!]The monitor notification audiences
autoTriageBooleanPer-monitor automated-triage override. true forces triage on for this monitor, false forces it off, and null (or omitting the argument) clears the override so the monitor inherits the domain/account setting. Because omitting the argument clears the override, an update call that does not send this field will reset any previously set override, including a deliberate false, back to inherit.
autoTuningBooleanPer-monitor auto-apply-tuning override. true forces auto-apply tuning on for this monitor, false forces it off, and null (or omitting the argument) clears the override so the monitor inherits the domain/account setting. Because omitting the argument clears the override, an update call that does not send this field will reset any previously set override, including a deliberate false, back to inherit.
clusterKeys[String!]Clusters to filter to (any-of) within clusteringSpaceUuid. Omit when segmenting by cluster_key — a segmented monitor covers every cluster in the space.
clusteringSpaceUuidUUIDConversation clustering space whose membership filters or segments the monitor. Requires isAgentConversationAggregation. Filter by naming clusters in clusterKeys, or segment by adding 'cluster_key' to segments.
collectionLagHoursIntCollection lag in hours (for the provided timestamp). When 0 or omitted, the account-level default collection lag applies (if one is configured). Default: 0.
connectionIdUUIDSpecify a connection (e.g. query-engine) to use
dataQualityDimensionStringData quality dimension.
dataSourceDataSourceUnionInput!
descriptionString!Used as the name in the UI
domainUuids[UUID!]Please provide one and only one valid domain uuid.
dryRunBooleanDry run the monitor creation or update and return the MaC YAML and queries. Default: false.
dwIdUUID!Warehouse the monitor will be run on.
failOnResetBooleanReturn an error if the update is a significant change that would require a monitor reset. Default: false.
failureAudiences[String!]The monitor notification audiences for failures
filtersFilterGroupInputStructured SQL filtering conditions to apply to query
highSegmentCountBooleanFlag to apply additional limits which increase the supported segment count Default: false.
isAgentConversationAggregationBooleanIf true, the monitor operates at the conversation grain: evaluation monitors score whole conversations, and metric monitors compute conversation-level metrics (turn_count, duration_seconds, total_tokens, ...). Default (false) operates on individual spans. Default: false.
isDraftBooleanMake target a draft monitor. Default: false.
notesStringAdditional context for the monitor Default: "".
priorityStringThe default priority for alerts involving this monitor
samplingConfigMonitorSamplingConfigInput!Sampling configuration: either percentage or fixed count
scheduleConfigScheduleConfigInput!Schedule of monitor
segmentCountHintIntSegment count when then monitor was created. Can be returned as the segment count for the monitor when no successful execution has yet occurred, and a fresh segment count is not available. This allows the UI to properly validate the monitor configuration and avoid creating monitors that will fail when they are created due too many metric combinations.
segments[FilterValueUnionInput!]Segments
sensitivitySensitivityLevelsSensitivity for automated thresholds.
skipResetBooleanDo not reset monitor if the update is a significant change that would normally cause the monitor to be reset. Learned model might not match the new monitor configuration and false positives might be detected for up to 35 days Default: false.
tags[TagKeyValuePairInput!]The monitor tags.
timeBucketedBooleanWhether to use time bucketing (True) or all rows (False). When False, aggregate_by is ignored and no time axis is used. Default: true.
uuidUUIDUUID of the monitor. If specified, it means the request is for update

Returns

CreateOrUpdateAgentEvaluationMonitor

Example

mutation CreateOrUpdateAgentEvaluationMonitor($agentSpanFilters: [AgentSpanFilterInput!]!, $alertConditions: [MetricAlertConditionInput!]!, $dataSource: DataSourceUnionInput!, $description: String!, $dwId: UUID!, $samplingConfig: MonitorSamplingConfigInput!, $scheduleConfig: ScheduleConfigInput!) {
  createOrUpdateAgentEvaluationMonitor(agentSpanFilters: $agentSpanFilters, alertConditions: $alertConditions, dataSource: $dataSource, description: $description, dwId: $dwId, samplingConfig: $samplingConfig, scheduleConfig: $scheduleConfig) {
    queries
    warnings
  }
}

Types used only by createOrUpdateAgentEvaluationMonitor

CreateOrUpdateAgentEvaluationMonitor

Object type. Create or update an Agent Evaluation monitor (with sampling_config and transforms).

FieldTypeDescription
agentMonitorMetricMonitoring
queries[String!]SQL queries that will be run by the monitor on each execution.
warnings[String!]Warnings about the monitor's agent, such as an agent with no recent conversation rows. A warning does not stop the save. Dry runs return the same warnings.

Related types

AgentSpanFilterInput, AlertGroupingInput, AudienceConditionInput, DataSourceUnionInput, FilterGroupInput, FilterValueUnionInput, MetricAlertConditionInput, MetricMonitoring, MonitorAggTimeInterval, MonitorSamplingConfigInput, ScheduleConfigInput, SensitivityLevels, TagKeyValuePairInput, UUID

createOrUpdateAgentMetricMonitor (mutation)

createOrUpdateAgentMetricMonitor is a mutation in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Create or update an Agent Metric monitor

Arguments

ArgumentTypeDescription
agentSpanFilters[AgentSpanFilterInput!]!Filter by agent span fields (agent, workflow, task, span_name)
aggregateByMonitorAggTimeIntervalAggregation time interval. When not using a hourly interval, the timecomponent of the event timestamp should be ignored. Default: "HOUR".
alertConditions[MetricAlertConditionInput!]!Alert conditions.
alertGroupingAlertGroupingInputPer-monitor alert grouping configuration. Omit or pass null for legacy per-type grouping; a non-null value enables monitor-based alert grouping. The createOrUpdate* mutations are full-state: omitting this field on an update clears any existing configuration (same as samplingConfig).
audienceConditions[AudienceConditionInput!]Narrows individual audiences to the triage priorities that reach them. Always a full replace: omitting the argument (or passing null) makes every audience unconditional, the same as passing an empty list; a non-empty list replaces the conditions wholesale. Every audience named here must also appear in this mutation's audience list (audiences, or labels on the mutations that spell it that way), which stays the monitor's full audience set — a condition narrows when one of them is notified, it does not add one.
audiences[String!]The monitor notification audiences
autoTriageBooleanPer-monitor automated-triage override. true forces triage on for this monitor, false forces it off, and null (or omitting the argument) clears the override so the monitor inherits the domain/account setting. Because omitting the argument clears the override, an update call that does not send this field will reset any previously set override, including a deliberate false, back to inherit.
autoTuningBooleanPer-monitor auto-apply-tuning override. true forces auto-apply tuning on for this monitor, false forces it off, and null (or omitting the argument) clears the override so the monitor inherits the domain/account setting. Because omitting the argument clears the override, an update call that does not send this field will reset any previously set override, including a deliberate false, back to inherit.
clusterKeys[String!]Clusters to filter to (any-of) within clusteringSpaceUuid. Omit when segmenting by cluster_key — a segmented monitor covers every cluster in the space.
clusteringSpaceUuidUUIDConversation clustering space whose membership filters or segments the monitor. Requires isAgentConversationAggregation. Filter by naming clusters in clusterKeys, or segment by adding 'cluster_key' to segments.
collectionLagHoursIntCollection lag in hours (for the provided timestamp). When 0 or omitted, the account-level default collection lag applies (if one is configured). Default: 0.
connectionIdUUIDSpecify a connection (e.g. query-engine) to use
dataQualityDimensionStringData quality dimension.
dataSourceDataSourceUnionInput!
descriptionString!Used as the name in the UI
domainUuids[UUID!]Please provide one and only one valid domain uuid.
dryRunBooleanDry run the monitor creation or update and return the MaC YAML and queries. Default: false.
dwIdUUID!Warehouse the monitor will be run on.
failOnResetBooleanReturn an error if the update is a significant change that would require a monitor reset. Default: false.
failureAudiences[String!]The monitor notification audiences for failures
filtersFilterGroupInputStructured SQL filtering conditions to apply to query
highSegmentCountBooleanFlag to apply additional limits which increase the supported segment count Default: false.
isAgentConversationAggregationBooleanIf true, the monitor operates at the conversation grain: evaluation monitors score whole conversations, and metric monitors compute conversation-level metrics (turn_count, duration_seconds, total_tokens, ...). Default (false) operates on individual spans. Default: false.
isAgentTraceAggregationBooleanIf true, aggregates spans by trace_id for trace-level metrics. Default (false) returns span-level data. Mutually exclusive with isAgentConversationAggregation. Default: false.
isDraftBooleanMake target a draft monitor. Default: false.
notesStringAdditional context for the monitor Default: "".
priorityStringThe default priority for alerts involving this monitor
scheduleConfigScheduleConfigInput!Schedule of monitor
segmentCountHintIntSegment count when then monitor was created. Can be returned as the segment count for the monitor when no successful execution has yet occurred, and a fresh segment count is not available. This allows the UI to properly validate the monitor configuration and avoid creating monitors that will fail when they are created due too many metric combinations.
segments[FilterValueUnionInput!]Segments
sensitivitySensitivityLevelsSensitivity for automated thresholds.
skipResetBooleanDo not reset monitor if the update is a significant change that would normally cause the monitor to be reset. Learned model might not match the new monitor configuration and false positives might be detected for up to 35 days Default: false.
tags[TagKeyValuePairInput!]The monitor tags.
timeBucketedBooleanWhether to use time bucketing (True) or all rows (False). When False, aggregate_by is ignored and no time axis is used. Default: true.
uuidUUIDUUID of the monitor. If specified, it means the request is for update

Returns

CreateOrUpdateAgentMetricMonitor

Example

mutation CreateOrUpdateAgentMetricMonitor($agentSpanFilters: [AgentSpanFilterInput!]!, $alertConditions: [MetricAlertConditionInput!]!, $dataSource: DataSourceUnionInput!, $description: String!, $dwId: UUID!, $scheduleConfig: ScheduleConfigInput!) {
  createOrUpdateAgentMetricMonitor(agentSpanFilters: $agentSpanFilters, alertConditions: $alertConditions, dataSource: $dataSource, description: $description, dwId: $dwId, scheduleConfig: $scheduleConfig) {
    queries
    warnings
  }
}

Types used only by createOrUpdateAgentMetricMonitor

CreateOrUpdateAgentMetricMonitor

Object type. Create or update an Agent Metric monitor (no sampling_config, no transforms)

FieldTypeDescription
agentMonitorMetricMonitoring
queries[String!]SQL queries that will be run by the monitor on each execution.
warnings[String!]Warnings about the monitor's agent, such as an agent with no recent conversation rows. A warning does not stop the save. Dry runs return the same warnings.

Related types

AgentSpanFilterInput, AlertGroupingInput, AudienceConditionInput, DataSourceUnionInput, FilterGroupInput, FilterValueUnionInput, MetricAlertConditionInput, MetricMonitoring, MonitorAggTimeInterval, ScheduleConfigInput, SensitivityLevels, TagKeyValuePairInput, UUID

createOrUpdateAgentTrajectory (mutation)

createOrUpdateAgentTrajectory is a mutation in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Create or update agent trajectory.

Arguments

ArgumentTypeDescription
agentSpanAlertConditionAgentSpanConditionInput!Agent span alert condition for filtering agent spans
agentSpanFilters[AgentSpanFilterInput!]Filter by agent span fields (agent, workflow, task, span_name)
alertGroupingAlertGroupingInputPer-monitor alert grouping configuration. Omit or pass null for legacy per-type grouping; a non-null value enables monitor-based alert grouping. The createOrUpdate* mutations are full-state: omitting this field on an update clears any existing configuration (same as samplingConfig).
audienceConditions[AudienceConditionInput!]Narrows individual audiences to the triage priorities that reach them. Always a full replace: omitting the argument (or passing null) makes every audience unconditional, the same as passing an empty list; a non-empty list replaces the conditions wholesale. Every audience named here must also appear in this mutation's audience list (audiences, or labels on the mutations that spell it that way), which stays the monitor's full audience set — a condition narrows when one of them is notified, it does not add one.
autoTriageBooleanPer-monitor automated-triage override. true forces triage on for this monitor, false forces it off, and null (or omitting the argument) clears the override so the monitor inherits the domain/account setting. Because omitting the argument clears the override, an update call that does not send this field will reset any previously set override, including a deliberate false, back to inherit.
autoTuningBooleanPer-monitor auto-apply-tuning override. true forces auto-apply tuning on for this monitor, false forces it off, and null (or omitting the argument) clears the override so the monitor inherits the domain/account setting. Because omitting the argument clears the override, an update call that does not send this field will reset any previously set override, including a deliberate false, back to inherit.
connectionIdUUIDSpecify a connection (e.g. query-engine) to use
customRuleUuidUUIDUUID of custom rule, to update existing rule
dataQualityDimensionStringData quality dimension on the custom rule.
dataSourceDataSourceUnionInput!
descriptionString!Description of rule
domainUuids[UUID!]Please provide one and only one valid domain uuid.
dryRunBooleanDry run the monitor creation or update and return the MaC YAML and queries. Default: false.
dwIdUUID!Warehouse UUID
eventRollupCountIntThe number of events to roll up into a single incident
eventRollupUntilChangedBooleanIf true, roll up events until the value changes
exceptionPrimaryKeyColumnStringSpecifies the column which contains the primary key for sampled data used in exception management.
failureAudiences[String!]The audiences to notify on failure
filtersFilterGroupInputStructured SQL filtering conditions to apply to query
intervalMinutesIntHow often to run scheduled custom rule check (DEPRECATED, use schedule instead)
isDraftBooleanMake target a draft monitor. Default: false.
isTrackingBooleanTrue tracks failures without alerts; false enables alerts. Omit or use null to keep an existing monitor's mode. New monitors alert by default.
labels[String]The monitor labels
notesStringAdditional context for the monitor Default: "".
notifyRuleRunFailureBooleanDEPRECATED: Completely ignored. This field has no effect on anything. Use failure_audiences to determine who is notified when run failures occur.
priorityStringThe default priority for alerts involving this monitor
scheduleConfigScheduleConfigInput!Schedule of the agent trajectory monitor
severityStringDEPRECATED. Use priority instead. The default severity for incidents involving this monitor Default: "".
startTimeDateTimeStart time of schedule (DEPRECATED, use schedule instead)
tags[TagKeyValuePairInput]The monitor tags.
timeFilterTimeFilterInput!Filter by time filter for trajectory evaluation
timeoutIntTimeout for the SQL query
timezoneStringTimezone (DEPRECATED, use timezone in scheduleConfig instead
trajectoryScopeTrajectoryScopeTRACE counts the conditions within each trace. CONVERSATION counts them over the spans that ran before each trigger span in the same conversation. Defaults to TRACE on create. On update, leaving this out keeps the stored scope.
triggerSpanFilterSpanInputSpan that triggers the check. Required for the CONVERSATION scope. On an update that ends up CONVERSATION, leaving this out keeps the stored trigger span.

Returns

CreateOrUpdateAgentTrajectory

Example

mutation CreateOrUpdateAgentTrajectory($agentSpanAlertCondition: AgentSpanConditionInput!, $dataSource: DataSourceUnionInput!, $description: String!, $dwId: UUID!, $scheduleConfig: ScheduleConfigInput!, $timeFilter: TimeFilterInput!) {
  createOrUpdateAgentTrajectory(agentSpanAlertCondition: $agentSpanAlertCondition, dataSource: $dataSource, description: $description, dwId: $dwId, scheduleConfig: $scheduleConfig, timeFilter: $timeFilter) {
    yaml
    queries
    warnings
  }
}

Types used only by createOrUpdateAgentTrajectory

CreateOrUpdateAgentTrajectory

Object type. Create or update an agent trajectory monitor

FieldTypeDescription
agentTrajectoryCustomRule
yamlString
queries[String!]SQL queries that will be run by the monitor on each execution.
warnings[String!]Warnings about the monitor's agent, such as an agent with no recent conversation rows. A warning does not stop the save. Dry runs return the same warnings.

Related types

AgentSpanConditionInput, AgentSpanFilterInput, AlertGroupingInput, AudienceConditionInput, CustomRule, DataSourceUnionInput, DateTime, FilterGroupInput, FilterSpanInput, ScheduleConfigInput, TagKeyValuePairInput, TimeFilterInput, TrajectoryScope, UUID

createOrUpdateAgentValidation (mutation)

createOrUpdateAgentValidation is a mutation in the Monte Carlo GraphQL API, in Agent traces and evaluations. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Create or update agent validation.

Arguments

ArgumentTypeDescription
agentSpanFilters[AgentSpanFilterInput!]!Filter by agent span fields (agent, workflow, task, span_name)
alertConditionFilterGroupInput!
alertGroupingAlertGroupingInputPer-monitor alert grouping configuration. Omit or pass null for legacy per-type grouping; a non-null value enables monitor-based alert grouping. The createOrUpdate* mutations are full-state: omitting this field on an update clears any existing configuration (same as samplingConfig).
audienceConditions[AudienceConditionInput!]Narrows individual audiences to the triage priorities that reach them. Always a full replace: omitting the argument (or passing null) makes every audience unconditional, the same as passing an empty list; a non-empty list replaces the conditions wholesale. Every audience named here must also appear in this mutation's audience list (audiences, or labels on the mutations that spell it that way), which stays the monitor's full audience set — a condition narrows when one of them is notified, it does not add one.
autoTriageBooleanPer-monitor automated-triage override. true forces triage on for this monitor, false forces it off, and null (or omitting the argument) clears the override so the monitor inherits the domain/account setting. Because omitting the argument clears the override, an update call that does not send this field will reset any previously set override, including a deliberate false, back to inherit.
autoTuningBooleanPer-monitor auto-apply-tuning override. true forces auto-apply tuning on for this monitor, false forces it off, and null (or omitting the argument) clears the override so the monitor inherits the domain/account setting. Because omitting the argument clears the override, an update call that does not send this field will reset any previously set override, including a deliberate false, back to inherit.
connectionIdUUIDSpecify a connection (e.g. query-engine) to use
customRuleUuidUUIDUUID of custom rule, to update existing rule
dataQualityDimensionStringData quality dimension on the custom rule.
dataSourceDataSourceUnionInput!
descriptionString!Description of rule
domainUuids[UUID!]Please provide one and only one valid domain uuid.
dryRunBooleanDry run the monitor creation or update and return the MaC YAML and queries. Default: false.
dwIdUUID!Warehouse UUID
eventRollupCountIntThe number of events to roll up into a single incident
eventRollupUntilChangedBooleanIf true, roll up events until the value changes
exceptionPrimaryKeyColumnStringSpecifies the column which contains the primary key for sampled data used in exception management.
failureAudiences[String!]The audiences to notify on failure
filtersFilterGroupInputStructured SQL filtering conditions to apply to query
intervalMinutesIntHow often to run scheduled custom rule check (DEPRECATED, use schedule instead)
isAgentTraceAggregationBooleanIf true, aggregates spans by trace_id for trace-level validation. Default (false) returns span-level data. Default: false.
isDraftBooleanMake target a draft monitor. Default: false.
isTrackingBooleanTrue tracks failures without alerts; false enables alerts. Omit or use null to keep an existing monitor's mode. New monitors alert by default.
labels[String]The monitor labels
notesStringAdditional context for the monitor Default: "".
notifyRuleRunFailureBooleanDEPRECATED: Completely ignored. This field has no effect on anything. Use failure_audiences to determine who is notified when run failures occur.
priorityStringThe default priority for alerts involving this monitor
scheduleConfigScheduleConfigInput!Schedule of the agent validation monitor
severityStringDEPRECATED. Use priority instead. The default severity for incidents involving this monitor Default: "".
startTimeDateTimeStart time of schedule (DEPRECATED, use schedule instead)
tags[TagKeyValuePairInput]The monitor tags.
timeFilterTimeFilterInput!Filter by time filter for evaluation
timeoutIntTimeout for the SQL query
timezoneStringTimezone (DEPRECATED, use timezone in scheduleConfig instead

Returns

CreateOrUpdateAgentValidation

Example

mutation CreateOrUpdateAgentValidation($agentSpanFilters: [AgentSpanFilterInput!]!, $alertCondition: FilterGroupInput!, $dataSource: DataSourceUnionInput!, $description: String!, $dwId: UUID!, $scheduleConfig: ScheduleConfigInput!, $timeFilter: TimeFilterInput!) {
  createOrUpdateAgentValidation(agentSpanFilters: $agentSpanFilters, alertCondition: $alertCondition, dataSource: $dataSource, description: $description, dwId: $dwId, scheduleConfig: $scheduleConfig, timeFilter: $timeFilter) {
    queries
  }
}

Types used only by createOrUpdateAgentValidation

CreateOrUpdateAgentValidation

Object type. Create or update an agent validation monitor

FieldTypeDescription
agentValidationCustomRule
queries[String!]SQL queries that will be run by the monitor on each execution.

Related types

AgentSpanFilterInput, AlertGroupingInput, AudienceConditionInput, CustomRule, DataSourceUnionInput, DateTime, FilterGroupInput, ScheduleConfigInput, TagKeyValuePairInput, TimeFilterInput, UUID

Source: The GraphQL API reference

This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.