Monitor definitions (GraphQL)

Related queries and mutations in Monitors. Each has its own section.

Queries

getAllUserDefinedMonitors (query)

getAllUserDefinedMonitors is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Arguments

ArgumentTypeDescription
userDefinedMonitorTypes[String]
beforeString
afterString
firstInt
lastInt

Returns

UserDefinedMonitorConnection

Example

query GetAllUserDefinedMonitors {
  getAllUserDefinedMonitors {
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}

Types used only by getAllUserDefinedMonitors

UserDefinedMonitorConnection

Object type.

FieldTypeDescription
pageInfoPageInfo!Pagination data for this connection.
edges[UserDefinedMonitorEdge]!Contains the nodes in this connection.
UserDefinedMonitorEdge

Object type. A Relay edge containing a UserDefinedMonitor and its cursor.

FieldTypeDescription
nodeUserDefinedMonitorThe item at the end of the edge
cursorString!A cursor for use in pagination

Related types

PageInfo, UserDefinedMonitor

getAllUserDefinedMonitorsV2 (query)

getAllUserDefinedMonitorsV2 is a query in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Arguments

ArgumentTypeDescription
userDefinedMonitorTypes[String]Filter by monitor type
createdBy[String]Filter by creator
orderByStringSorting of results
entities[String]Filter by associated entities (full table ID)
mcons[String]Filter by associated entities (MCON)
descriptionFieldOrTable[String]Match text on rule description, table, or field
domainIdUUIDFilter by domain UUID
isTemplateManagedBooleanFilter monitors created by code
isOotbReplacementBooleanFilter monitors which replace a default ootb detector Default: false.
namespace[String]Filter by namespace -> used in monitors created by code
ruleName[String]Filter by rule_name -> used in monitors created by code
search[String]Filter by: description, field, table, rule name, creator, namespace
beforeString
afterString
firstInt
lastInt

Returns

UserDefinedMonitorConnectionV2Connection

Example

query GetAllUserDefinedMonitorsV2 {
  getAllUserDefinedMonitorsV2 {
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}

Types used only by getAllUserDefinedMonitorsV2

UserDefinedMonitorConnectionV2Connection

Object type.

FieldTypeDescription
pageInfoPageInfo!Pagination data for this connection.
edges[UserDefinedMonitorConnectionV2Edge]!Contains the nodes in this connection.
UserDefinedMonitorConnectionV2Edge

Object type. A Relay edge containing a UserDefinedMonitorConnectionV2 and its cursor.

FieldTypeDescription
nodeUserDefinedMonitorV2The item at the end of the edge
cursorString!A cursor for use in pagination

Related types

PageInfo, UUID, UserDefinedMonitorV2

Mutations

createDraftMonitorFromYaml (mutation)

createDraftMonitorFromYaml is a mutation in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Create a draft monitor from YAML configuration

Arguments

ArgumentTypeDescription
dryRunBooleanIf true, validate the YAML without creating the monitor Default: false.
isDraftBooleanIf true (default), create as a draft. If false, create as a production monitor. Overrides any is_draft the YAML itself declares. Default: true.
yamlStringString!YAML string containing monitor configuration

Returns

CreateDraftMonitorFromYamlOutput

Example

mutation CreateDraftMonitorFromYaml($yamlString: String!) {
  createDraftMonitorFromYaml(yamlString: $yamlString) {
    warnings
  }
}

Types used only by createDraftMonitorFromYaml

CreateDraftMonitorFromYamlOutput

Object type. Output for createDraftMonitorFromYaml mutation.

FieldTypeDescription
monitorCreatedMonitorCreated monitor information
errors[MonitorError!]List of errors if creation failed
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.
CreatedMonitor

Object type. Information about the created monitor.

FieldTypeDescription
uuidUUID!UUID of the created monitor
monitorTypeUserDefinedMonitors!Type of the monitor
monitorNameString!Name of the monitor
isDraftBoolean!Whether the monitor is a draft
MonitorError

Object type. Error information for monitor creation failures.

FieldTypeDescription
messageString!Error message
fieldStringField that caused the error
codeString!Error code

Related types

UUID, UserDefinedMonitors

createOrUpdateComparisonMonitor (mutation)

createOrUpdateComparisonMonitor is a mutation in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Create or Update a Comparison Monitor

Arguments

ArgumentTypeDescription
alertConditions[ComparisonAlertConditionInput!]!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.
dataQualityDimensionStringData quality dimension.
descriptionString!Description of monitor
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.
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
isDraftBooleanMake target a draft monitor. Default: false.
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 custom monitor
skipResetBooleanDo not reset monitor if the update is a significant change that would normally cause the monitor to be reset. Default: false.
sourceExtendedDataSourceInput!source for comparison monitor
tags[TagKeyValuePairInput!]The monitor tags.
targetExtendedDataSourceInput!target for comparison monitor
uuidUUIDUUID of the monitor. If specified, it means the request is for update

Returns

CreateOrUpdateComparisonMonitor

Example

mutation CreateOrUpdateComparisonMonitor($alertConditions: [ComparisonAlertConditionInput!]!, $description: String!, $scheduleConfig: ScheduleConfigInput!, $source: ExtendedDataSourceInput!, $target: ExtendedDataSourceInput!) {
  createOrUpdateComparisonMonitor(alertConditions: $alertConditions, description: $description, scheduleConfig: $scheduleConfig, source: $source, target: $target) {
    yaml
    sourceQueries
    targetQueries
    persistBlockedBy
    spendGuardrailMessage
  }
}

Types used only by createOrUpdateComparisonMonitor

CreateOrUpdateComparisonMonitor

Object type. Create or update a comparison monitor

FieldTypeDescription
comparisonMonitorComparisonMonitorResponse
yamlString
sourceQueries[String!]SQL queries that will be run by the monitor for source on each execution.
targetQueries[String!]SQL queries that will be run by the monitor for target on each execution.
estimatedCreditsEstimatedCreditsSpec-derived daily credit estimate. Computed from the provided input config, not from persisted DB state — so dry-run, draft, and full create/update all return a consistent preview. Only populated for accounts on the per-monitor credit consumption pricing model; null otherwise.
persistBlockedByStringSet on dry runs only. Says why saving this monitor would not give the result the preview shows. A permission path, such as monitors/management/metric/edit, means the caller lacks it and the save would be refused. The caller can still save the monitor as a draft if it has the monitor type's draft permission. SPEND_GUARDRAIL means a spend guardrail is reached, so the save would create this new monitor as a draft instead of live. spendGuardrailMessage names the guardrail. When both apply, the permission path is returned. Null when the save would go through as previewed, and on requests that are not dry runs.
spendGuardrailMessageStringSet when a reached spend guardrail makes the save create this new monitor as a draft instead of live: on a dry run, when the save would do so, and on the save itself, when it did. A sentence for the user that names the guardrail (the account's or a domain's), its amount and when it resets, and says that an Account Owner can raise it. On a dry run whose persistBlockedBy is a permission path, the save is refused instead, so read that first. Null otherwise, including for a monitor saved as a draft on request, and for updates to an existing monitor.

Related types

AlertGroupingInput, AudienceConditionInput, ComparisonAlertConditionInput, ComparisonMonitorResponse, EstimatedCredits, ExtendedDataSourceInput, ScheduleConfigInput, TagKeyValuePairInput, UUID

createOrUpdateFieldQualityRule (mutation)

createOrUpdateFieldQualityRule is a mutation in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Create or update a field quality rule

Arguments

ArgumentTypeDescription
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.
comparisons[CustomRuleComparisonInput]!Custom rule comparisons
connectionIdUUIDSpecify a connection (e.g. query-engine) to use
customRuleUuidUUIDUUID of custom rule, to update existing rule
dataQualityDimensionStringData quality dimension on the custom rule.
descriptionString!Description of rule
domainUuids[UUID!]Please provide one and only one valid domain uuid.
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
fieldNames[String]!Fields to monitor
filters[FieldMetricFilterInput]Filters for which rows the metric is computed over
intervalMinutesIntHow often to run scheduled custom rule check (DEPRECATED, use schedule instead)
labels[String]The monitor labels
metricTypeFieldMetricType!Type of metric to compute
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 field quality rule
severityStringDEPRECATED. Use priority instead. The default severity for incidents involving this monitor Default: "".
startTimeDateTimeStart time of schedule (DEPRECATED, use schedule instead)
tableMcons[String]!MCON of tables to monitor
tags[TagKeyValuePairInput]The monitor tags.
timeoutIntTimeout for the SQL query
timezoneStringTimezone (DEPRECATED, use timezone in scheduleConfig instead

Returns

CreateOrUpdateFieldQualityRule

Example

mutation CreateOrUpdateFieldQualityRule($comparisons: [CustomRuleComparisonInput]!, $description: String!, $dwId: UUID!, $fieldNames: [String]!, $metricType: FieldMetricType!, $scheduleConfig: ScheduleConfigInput!, $tableMcons: [String]!) {
  createOrUpdateFieldQualityRule(comparisons: $comparisons, description: $description, dwId: $dwId, fieldNames: $fieldNames, metricType: $metricType, scheduleConfig: $scheduleConfig, tableMcons: $tableMcons) {
    customRule {
      id
      createdTime
      updatedTime
      uuid
      accountUuid
      projects
      datasets
      isDeleted
      deletedAt
      description
      notes
      labels
      failureAudiences
      isTemplateManaged
      namespace
      priority
      isPaused
      pausedReason
      isDraft
      isAutoCreated
    }
  }
}

Types used only by createOrUpdateFieldQualityRule

CreateOrUpdateFieldQualityRule

Object type. Create or update a field quality rule

FieldTypeDescription
customRuleCustomRule

Related types

AlertGroupingInput, AudienceConditionInput, CustomRule, CustomRuleComparisonInput, DateTime, FieldMetricFilterInput, FieldMetricType, ScheduleConfigInput, TagKeyValuePairInput, UUID

createOrUpdateJsonSchemaMonitor (mutation)

createOrUpdateJsonSchemaMonitor is a mutation in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Create or update a JSON schema monitor

Arguments

ArgumentTypeDescription
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.
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
fieldString!Field to monitor
isDraftBooleanMake target a draft monitor. Default: false.
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
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.
timeAxisFilterValueUnionInputTime axis to filter recent data by
uuidUUIDUUID of the monitor. If specified, it means the request is for update
whereConditionStringSQL WHERE condition to apply to query

Returns

CreateOrUpdateJsonSchemaMonitor

Example

mutation CreateOrUpdateJsonSchemaMonitor($dataSource: DataSourceUnionInput!, $description: String!, $dwId: UUID!, $field: String!) {
  createOrUpdateJsonSchemaMonitor(dataSource: $dataSource, description: $description, dwId: $dwId, field: $field) {
    yaml
    queries
  }
}

Types used only by createOrUpdateJsonSchemaMonitor

CreateOrUpdateJsonSchemaMonitor

Object type.

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

Related types

AudienceConditionInput, DataSourceUnionInput, FilterValueUnionInput, MetricMonitoring, TagKeyValuePairInput, UUID

createOrUpdateMetricMonitor (mutation)

createOrUpdateMetricMonitor is a mutation in the Monte Carlo GraphQL API, in Monitors. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Create or update a Metric monitor

Arguments

ArgumentTypeDescription
aggregateAggregateInputThe time aggregation to use.
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.
collectionLagHoursIntCollection lag in hours (for the provided timestamp) Default: 0.
connectionIdUUIDSpecify a connection (e.g. query-engine) to use
dataQualityDimensionStringData quality dimension.
dataSourceDataSourceUnionInput!
descriptionString!Used as the name in the UI
disableLookBackBootstrapBooleanThe flag decides whether to disable look back bootstrap for new monitors. By default, it's False Default: false.
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
highSegmentCountBooleanFlag to apply additional limits which increase the supported segment count Default: false.
isDraftBooleanMake target a draft monitor. Default: false.
minSegmentRowCountIntMinimum rolling-average row count for a segment to be monitored. Segments whose average row count falls below this are not detected on. Null disables the filter.
minSegmentRowCountShareFloatMinimum share of the table's total rolling-average row count for a segment to be monitored, as a fraction between 0 and 1. Segments contributing a smaller share than this are not detected on. Null disables the filter.
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
samplingConfigMonitorSamplingConfigInputSampling configuration. Required when using eval_prompt transforms.
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.
timeoutIntTimeout for the SQL query
usePartitionClauseBooleanWhether to use automatic partition filter in query Default: false.
uuidUUIDUUID of the monitor. If specified, it means the request is for update
whereConditionStringSQL WHERE condition to apply to query

Returns

CreateOrUpdateMetricMonitor

Example

mutation CreateOrUpdateMetricMonitor($alertConditions: [MetricAlertConditionInput!]!, $dataSource: DataSourceUnionInput!, $description: String!, $dwId: UUID!, $scheduleConfig: ScheduleConfigInput!) {
  createOrUpdateMetricMonitor(alertConditions: $alertConditions, dataSource: $dataSource, description: $description, dwId: $dwId, scheduleConfig: $scheduleConfig) {
    yaml
    queries
    persistBlockedBy
    spendGuardrailMessage
  }
}

Types used only by createOrUpdateMetricMonitor

CreateOrUpdateMetricMonitor

Object type.

FieldTypeDescription
metricMonitorMetricMonitoring
yamlString
queries[String!]SQL queries that will be run by the monitor on each execution.
estimatedCreditsEstimatedCreditsSpec-derived daily credit estimate. Computed from the provided input config, not from persisted DB state — so dry-run, draft, and full create/update all return a consistent preview. Only populated for accounts on the per-monitor credit consumption pricing model; null otherwise.
persistBlockedByStringSet on dry runs only. Says why saving this monitor would not give the result the preview shows. A permission path, such as monitors/management/metric/edit, means the caller lacks it and the save would be refused. The caller can still save the monitor as a draft if it has the monitor type's draft permission. SPEND_GUARDRAIL means a spend guardrail is reached, so the save would create this new monitor as a draft instead of live. spendGuardrailMessage names the guardrail. When both apply, the permission path is returned. Null when the save would go through as previewed, and on requests that are not dry runs.
spendGuardrailMessageStringSet when a reached spend guardrail makes the save create this new monitor as a draft instead of live: on a dry run, when the save would do so, and on the save itself, when it did. A sentence for the user that names the guardrail (the account's or a domain's), its amount and when it resets, and says that an Account Owner can raise it. On a dry run whose persistBlockedBy is a permission path, the save is refused instead, so read that first. Null otherwise, including for a monitor saved as a draft on request, and for updates to an existing monitor.

Related types

AggregateInput, AlertGroupingInput, AudienceConditionInput, DataSourceUnionInput, EstimatedCredits, FilterValueUnionInput, MetricAlertConditionInput, MetricMonitoring, MonitorSamplingConfigInput, ScheduleConfigInput, SensitivityLevels, TagKeyValuePairInput, UUID

Source: The GraphQL API reference

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