Related queries and mutations in Monitors. Each has its own section.
Queries
getCircuitBreakerRuleState (query)
getCircuitBreakerRuleState 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.
Status: Deprecated: Use GetCircuitBreakerRuleStateV2 instead to support rules with multiple executions
State for the circuit breaker rule job execution
Arguments
| Argument | Type | Description |
|---|---|---|
jobExecutionUuid | UUID! | The UUID of the job execution to get the state for |
Returns
Example
query GetCircuitBreakerRuleState($jobExecutionUuid: UUID!) {
getCircuitBreakerRuleState(jobExecutionUuid: $jobExecutionUuid) {
jobExecutionUuid
accountUuid
resourceUuid
customRuleUuid
status
log
}
}Related types
getCircuitBreakerRuleStateV2 (query)
getCircuitBreakerRuleStateV2 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.
State for the circuit breaker rule job executions
Arguments
| Argument | Type | Description |
|---|---|---|
jobExecutionUuids | [UUID]! | The UUIDs of the job executions to get the state for |
Returns
Example
query GetCircuitBreakerRuleStateV2($jobExecutionUuids: [UUID]!) {
getCircuitBreakerRuleStateV2(jobExecutionUuids: $jobExecutionUuids) {
jobExecutionUuid
accountUuid
resourceUuid
customRuleUuid
status
log
}
}Related types
getCustomRule (query)
getCustomRule 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.
Get a custom rule
Arguments
| Argument | Type | Description |
|---|---|---|
ruleId | UUID | Rule id |
descriptionContains | String | String to completely or partially match the rule description, case-insensitive |
customSqlContains | String | String to completely or partially match the rule SQL, case-insensitive |
Returns
Example
query GetCustomRule {
getCustomRule {
id
createdTime
updatedTime
uuid
accountUuid
projects
datasets
isDeleted
deletedAt
description
notes
labels
failureAudiences
isTemplateManaged
namespace
priority
isPaused
pausedReason
isDraft
isAutoCreated
}
}Related types
getCustomRuleExecutionAnalytics (query)
getCustomRuleExecutionAnalytics 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.
Return analytics for the executions of the custom rules
Arguments
| Argument | Type | Description |
|---|---|---|
ruleId | UUID! | Rule id |
startTime | DateTime! | Beginning of time range to calculate the execution analytics |
endTime | DateTime | End of time range to calculate the execution analytics |
timezone | String | Timezone to apply when grouping by date |
groupBy | PeriodGrouping! | Time buckets to group time-bound analytics by. |
Returns
[CustomRuleExecutionAnalytics!]!
Example
query GetCustomRuleExecutionAnalytics($ruleId: UUID!, $startTime: DateTime!, $groupBy: PeriodGrouping!) {
getCustomRuleExecutionAnalytics(ruleId: $ruleId, startTime: $startTime, groupBy: $groupBy) {
date
runs
passes
breaches
}
}Types used only by getCustomRuleExecutionAnalytics
getCustomRuleExecutionAnalyticsCustomRuleExecutionAnalytics
CustomRuleExecutionAnalyticsObject type.
| Field | Type | Description |
|---|---|---|
date | DateTime! | Date for the analytics, if grouped by week/month it has the start of each grouping period |
runs | Int! | Number of runs |
passes | Int! | Number of passes |
breaches | Int! | Number of breaches |
Related types
DateTime, PeriodGrouping, UUID
getCustomRules (query)
getCustomRules 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
| Argument | Type | Description |
|---|---|---|
entityMcons | [String] | Return rules associated with any of these table MCONs |
metadataKeys | [String] | Return rules with all these keys in their metadata |
offset | Int | |
before | String | |
after | String | |
first | Int | |
last | Int | |
ruleType | CustomRuleModelRuleType | |
warehouseUuid | UUID |
Returns
Example
query GetCustomRules {
getCustomRules {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
}
}Related types
CustomRuleConnection, CustomRuleModelRuleType, UUID
getCustomSqlTemplates (query)
getCustomSqlTemplates 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.
Get all active Custom SQL Templates
Arguments
| Argument | Type | Description |
|---|---|---|
queryResultTypeFilter | QueryResultType | CustomSQLTemplate's query result type can be set to SINGLE_NUMERIC, ROW_COUNT and LABELED_NUMERICS. The filter is None then all templates are returned |
offset | Int | |
before | String | |
after | String | |
first | Int | |
last | Int | |
uuid | UUID | |
name | String | |
description | String | |
sqlTemplate | String | |
dialect | String | |
queryResultType | CustomSQLTemplateModelQueryResultType |
Returns
Example
query GetCustomSqlTemplates {
getCustomSqlTemplates {
totalCount
edgeCount
}
}Related types
CustomSQLTemplateConnection, CustomSQLTemplateModelQueryResultType, QueryResultType, UUID
getFieldMetricQuery (query)
getFieldMetricQuery 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.
Status: Deprecated: DEPRECATED: Use Custom SQL monitors instead.
DEPRECATED: Build field quality rule query from parameters
Arguments
| Argument | Type | Description |
|---|---|---|
fieldMetric | FieldMetricInput! | field quality rule query parameters |
Returns
FieldMetricQuery
Example
query GetFieldMetricQuery($fieldMetric: FieldMetricInput!) {
getFieldMetricQuery(fieldMetric: $fieldMetric) {
sqlQuery
}
}Types used only by getFieldMetricQuery
getFieldMetricQueryFieldMetricQuery
FieldMetricQueryObject type.
| Field | Type | Description |
|---|---|---|
sqlQuery | String | SQL query for the metric |
Related types
getFieldQuery (query)
getFieldQuery 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.
Status: Deprecated: DEPRECATED: Use Custom SQL monitors instead.
Build field quality rule SQL query from parameters
Arguments
| Argument | Type | Description |
|---|---|---|
fieldQueryParameters | FieldQueryParametersInput! | Field quality rule query parameters |
Returns
FieldQuery
Example
query GetFieldQuery($fieldQueryParameters: FieldQueryParametersInput!) {
getFieldQuery(fieldQueryParameters: $fieldQueryParameters) {
sqlQuery
variables
}
}Types used only by getFieldQuery
getFieldQueryFieldQuery
FieldQueryObject type.
| Field | Type | Description |
|---|---|---|
sqlQuery | String | SQL query |
variables | JSONString | Possible variable values for SQL query |
Related types
FieldQueryParametersInput, JSONString
getGeneratedRules (query)
getGeneratedRules 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
| Argument | Type | Description |
|---|---|---|
generatedByUuid | UUID | Parent CustomRule UUID |
Returns
Example
query GetGeneratedRules {
getGeneratedRules {
id
createdTime
updatedTime
uuid
accountUuid
projects
datasets
isDeleted
deletedAt
description
notes
labels
failureAudiences
isTemplateManaged
namespace
priority
isPaused
pausedReason
isDraft
isAutoCreated
}
}Related types
getNotificationSettingsForRulesWith (query)
getNotificationSettingsForRulesWith 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.
Status: Deprecated: Use getNotificationSettingsForAudience instead
DEPRECATED. The notification settings that will be used in a rule with the specified data
Arguments
| Argument | Type | Description |
|---|---|---|
ruleType | String! | Rule type. |
warehouseUuid | UUID! | Warehouse UUID. |
fullTableIds | [String] | Full table ids. |
labelNames | [String] | Monitor labels. |
Returns
Example
query GetNotificationSettingsForRulesWith($ruleType: String!, $warehouseUuid: UUID!) {
getNotificationSettingsForRulesWith(ruleType: $ruleType, warehouseUuid: $warehouseUuid) {
id
deletedAt
uuid
createdTime
lastUpdateTime
name
isTemplateManaged
namespace
type
recipients
extra
notificationScheduleType
notificationEnabled
recipientDisplayName
recipientsDisplayNames
permalink
alertSubTypes
customMessage
integrationId
channelUrl
}
}Related types
AccountNotificationSetting, UUID
getQueryTemplate (query)
getQueryTemplate 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.
Status: Deprecated: DEPRECATED: Use Validation monitors instead for referential integrity checks.
DEPRECATED. Gets a query template
Arguments
| Argument | Type | Description |
|---|---|---|
queryTemplateId | String! | ID for the template used to generate this query |
warehouseUuid | UUID | UUID for the warehouse where the run will be executed |
variableValues | [QueryTemplateVariableValueInput!] | Values for the template variables. If not provided, the template source will be returned |
Returns
QueryTemplateOutput
Example
query GetQueryTemplate($queryTemplateId: String!) {
getQueryTemplate(queryTemplateId: $queryTemplateId) {
id
sqlQuery
}
}Types used only by getQueryTemplate
getQueryTemplateQueryTemplateOutput
QueryTemplateOutputObject type.
| Field | Type | Description |
|---|---|---|
id | String | The template ID |
sqlQuery | String | The SQL query template |
variables | [QueryTemplateVariable] | Variables for the query |
QueryTemplateVariable
QueryTemplateVariableObject type.
| Field | Type | Description |
|---|---|---|
name | String | Variable name |
Related types
QueryTemplateVariableValueInput, UUID
getRunSqlRuleState (query)
getRunSqlRuleState 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.
State for the sql rule job executions
Arguments
| Argument | Type | Description |
|---|---|---|
jobExecutionUuids | [UUID]! | The UUID of the job execution to get the state for |
Returns
Example
query GetRunSqlRuleState($jobExecutionUuids: [UUID]!) {
getRunSqlRuleState(jobExecutionUuids: $jobExecutionUuids) {
jobExecutionUuid
accountUuid
resourceUuid
customRuleUuid
status
log
}
}Related types
getTablesForSql (query)
getTablesForSql 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.
The full table ids calculated from the sql query
Arguments
| Argument | Type | Description |
|---|---|---|
warehouseUuid | UUID! | Warehouse UUID. |
customSql | String! | Custom SQL query to run |
customSamplingSql | String | Custom sampling SQL query to run on breach |
variables | JSONString | Possible variable values for SQL query |
Returns
[SqlQueryTable]
Example
query GetTablesForSql($warehouseUuid: UUID!, $customSql: String!) {
getTablesForSql(warehouseUuid: $warehouseUuid, customSql: $customSql) {
fullTableId
mcon
}
}Types used only by getTablesForSql
getTablesForSqlSqlQueryTable
SqlQueryTableObject type.
| Field | Type | Description |
|---|---|---|
fullTableId | String | Full table id of the table |
mcon | String | MCONs of the table |
Related types
Mutations
createCustomMetricRule (mutation)
createCustomMetricRule 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: Deprecated: Use CreateOrUpdateCustomSqlRule instead.
Deprecated, use CreateOrUpdateCustomMetricRule instead
Arguments
| Argument | Type | Description |
|---|---|---|
alertGrouping | AlertGroupingInput | Per-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. |
autoTriage | Boolean | Per-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. |
comparisons | [CustomRuleComparisonInput]! | Custom rule comparisons |
connectionId | UUID | Specify a connection (e.g. query-engine) to use |
customRuleUuid | UUID | UUID of custom rule, to update existing rule |
customSamplingSql | String | Custom sampling SQL query to run on breach |
customSql | String! | Custom SQL query to run |
dataQualityDimension | String | Data quality dimension on the custom rule. |
description | String! | Description of rule |
domainUuids | [UUID!] | Please provide one and only one valid domain uuid. |
dwId | UUID! | Warehouse UUID |
eventRollupCount | Int | The number of events to roll up into a single incident |
eventRollupUntilChanged | Boolean | If true, roll up events until the value changes |
exceptionPrimaryKeyColumn | String | Specifies the column which contains the primary key for sampled data used in exception management. |
failOnReset | Boolean | Return an error if the update is a significant change that would require a monitor reset. Default: false. |
failureAudiences | [String!] | The audiences to notify on failure |
fieldMetric | FieldMetricInput | (DEPRECATED). Use standard Custom SQL monitors instead. |
fieldQueryParameters | FieldQueryParametersInput | (DEPRECATED). Use Validation monitors instead for cardinality checks. |
intervalMinutes | Int | How often to run scheduled custom rule check (DEPRECATED, use schedule instead) |
labels | [String] | The monitor labels |
notes | String | Additional context for the monitor Default: "". |
notifyRuleRunFailure | Boolean | DEPRECATED: Completely ignored. This field has no effect on anything. Use failure_audiences to determine who is notified when run failures occur. |
priority | String | The default priority for alerts involving this monitor |
queryResultType | QueryResultType | How the query result is used for the metric. Uses row count if unset. |
queryTemplateId | String | (DEPRECATED). Use Validation monitors instead for referential integrity checks. |
queryTemplateVariableValues | [QueryTemplateVariableValueInput!] | (DEPRECATED). Use Validation monitors instead for referential integrity checks. |
scheduleConfig | ScheduleConfigInput | Schedule of custom rule |
severity | String | DEPRECATED. Use priority instead. The default severity for incidents involving this monitor Default: "". |
skipReset | Boolean | Do 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. |
startTime | DateTime | Start time of schedule (DEPRECATED, use schedule instead) |
tags | [TagKeyValuePairInput] | The monitor tags. |
timeout | Int | Timeout for the SQL query |
timezone | String | Timezone (DEPRECATED, use timezone in scheduleConfig instead |
variableDefinitions | [VariableDefinitionInput!] | Possible variable values for SQL query. Allows specifying runtime variables as well. |
variables | JSONString | Possible variable values for SQL query. Only to specify static variables. |
Returns
CreateCustomMetricRule
Example
mutation CreateCustomMetricRule($comparisons: [CustomRuleComparisonInput]!, $customSql: String!, $description: String!, $dwId: UUID!) {
createCustomMetricRule(comparisons: $comparisons, customSql: $customSql, description: $description, dwId: $dwId) {
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 createCustomMetricRule
createCustomMetricRuleCreateCustomMetricRule
CreateCustomMetricRuleObject type. Deprecated, use CreateOrUpdateCustomMetricRule instead
| Field | Type | Description |
|---|---|---|
customRule | CustomRule |
Related types
AlertGroupingInput, AudienceConditionInput, CustomRule, CustomRuleComparisonInput, DateTime, FieldMetricInput, FieldQueryParametersInput, JSONString, QueryResultType, QueryTemplateVariableValueInput, ScheduleConfigInput, TagKeyValuePairInput, UUID, VariableDefinitionInput
createCustomRule (mutation)
createCustomRule 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: Deprecated: Depending on the type of monitor you would like to create, use CreateOrUpdateVolumeRule, CreateOrUpdateFreshnessCustomRule, CreateOrUpdateCustomSqlRule, CreateOrUpdateComparisonRule or CreateOrUpdateQueryPerfRule instead.
Deprecated, use CreateOrUpdateCustomRule instead
Arguments
| Argument | Type | Description |
|---|---|---|
alertGrouping | AlertGroupingInput | Per-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 |
customRuleUuid | UUID | UUID of custom rule, to update existing rule |
dataQualityDimension | String | Data quality dimension on the custom rule. |
description | String | Used as the name in the UI |
domainUuids | [UUID!] | Please provide one and only one valid domain uuid. |
dwId | UUID | Warehouse the tables are contained in. Required when using fullTableIds |
eventRollupCount | Int | The number of events to roll up into a single incident |
eventRollupUntilChanged | Boolean | If true, roll up events until the value changes |
exceptionPrimaryKeyColumn | String | Specifies the column which contains the primary key for sampled data used in exception management. |
failureAudiences | [String!] | The audiences to notify on failure |
intervalMinutes | Int | How often to run scheduled custom rule check (DEPRECATED, use schedule instead) |
labels | [String] | The monitor labels |
notes | String | Additional context for the monitor Default: "". |
notifyRuleRunFailure | Boolean | DEPRECATED: Completely ignored. This field has no effect on anything. Use failure_audiences to determine who is notified when run failures occur. |
priority | String | The default priority for alerts involving this monitor |
scheduleConfig | ScheduleConfigInput | Schedule of custom rule |
severity | String | DEPRECATED. Use priority instead. The default severity for incidents involving this monitor Default: "". |
startTime | DateTime | Start time of schedule (DEPRECATED, use schedule instead) |
tags | [TagKeyValuePairInput] | The monitor tags. |
timezone | String | Timezone (DEPRECATED, use timezone in scheduleConfig instead |
Returns
CreateCustomRule
Example
mutation CreateCustomRule($comparisons: [CustomRuleComparisonInput]!) {
createCustomRule(comparisons: $comparisons) {
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 createCustomRule
createCustomRuleCreateCustomRule
CreateCustomRuleObject type. Deprecated, use CreateOrUpdateCustomRule instead
| Field | Type | Description |
|---|---|---|
customRule | CustomRule |
Related types
AlertGroupingInput, AudienceConditionInput, CustomRule, CustomRuleComparisonInput, DateTime, ScheduleConfigInput, TagKeyValuePairInput, UUID
createOrUpdateComparisonRule (mutation)
createOrUpdateComparisonRule 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
| Argument | Type | Description |
|---|---|---|
alertGrouping | AlertGroupingInput | Per-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. |
autoTriage | Boolean | Per-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. |
comparisons | [CustomRuleComparisonInput]! | Custom rule comparisons |
customRuleUuid | UUID | UUID of custom rule, to update existing rule |
dataQualityDimension | String | Data quality dimension on the custom rule. |
description | String! | Description of rule |
domainUuids | [UUID!] | Please provide one and only one valid domain uuid. |
dryRun | Boolean | Dry run the monitor creation or update and return the MaC YAML and queries. Default: false. |
eventRollupCount | Int | The number of events to roll up into a single incident |
eventRollupUntilChanged | Boolean | If true, roll up events until the value changes |
exceptionPrimaryKeyColumn | String | Specifies the column which contains the primary key for sampled data used in exception management. |
failureAudiences | [String!] | The audiences to notify on failure |
labels | [String] | The monitor labels |
notes | String | Additional context for the monitor Default: "". |
notifyRuleRunFailure | Boolean | DEPRECATED: Completely ignored. This field has no effect on anything. Use failure_audiences to determine who is notified when run failures occur. |
priority | String | The default priority for alerts involving this monitor |
queryResultType | QueryResultType! | Specifies query result format for generating metrics |
scheduleConfig | ScheduleConfigInput! | Schedule of custom rule |
severity | String | DEPRECATED. Use priority instead. The default severity for incidents involving this monitor Default: "". |
sourceConnectionId | UUID | Connection (i.e. query-engine) to use for source query |
sourceDwId | UUID! | Warehouse UUID for source query |
sourceSqlQuery | String! | Query to generate source metric |
tags | [TagKeyValuePairInput] | The monitor tags. |
targetConnectionId | UUID | Connection (i.e. query-engine) to use for target query |
targetDwId | UUID! | Warehouse UUID for target query |
targetSqlQuery | String! | Query to generate target metric |
Returns
CreateOrUpdateComparisonRule
Example
mutation CreateOrUpdateComparisonRule($comparisons: [CustomRuleComparisonInput]!, $description: String!, $queryResultType: QueryResultType!, $scheduleConfig: ScheduleConfigInput!, $sourceDwId: UUID!, $sourceSqlQuery: String!, $targetDwId: UUID!, $targetSqlQuery: String!) {
createOrUpdateComparisonRule(comparisons: $comparisons, description: $description, queryResultType: $queryResultType, scheduleConfig: $scheduleConfig, sourceDwId: $sourceDwId, sourceSqlQuery: $sourceSqlQuery, targetDwId: $targetDwId, targetSqlQuery: $targetSqlQuery) {
yaml
queries
}
}Types used only by createOrUpdateComparisonRule
createOrUpdateComparisonRuleCreateOrUpdateComparisonRule
CreateOrUpdateComparisonRuleObject type. Create or update a comparison rule
| Field | Type | Description |
|---|---|---|
customRule | CustomRule | |
yaml | String | |
queries | [String!] | SQL queries that will be run by the monitor on each execution. |
Related types
AlertGroupingInput, AudienceConditionInput, CustomRule, CustomRuleComparisonInput, QueryResultType, ScheduleConfigInput, TagKeyValuePairInput, UUID
createOrUpdateCustomMetricRule (mutation)
createOrUpdateCustomMetricRule 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: Deprecated: Use CreateOrUpdateCustomSqlRule instead.
Create or update a custom metric rule
Arguments
| Argument | Type | Description |
|---|---|---|
alertGrouping | AlertGroupingInput | Per-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. |
autoTriage | Boolean | Per-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. |
comparisons | [CustomRuleComparisonInput]! | Custom rule comparisons |
connectionId | UUID | Specify a connection (e.g. query-engine) to use |
customRuleUuid | UUID | UUID of custom rule, to update existing rule |
customSamplingSql | String | Custom sampling SQL query to run on breach |
customSql | String! | Custom SQL query to run |
dataQualityDimension | String | Data quality dimension on the custom rule. |
description | String! | Description of rule |
domainUuids | [UUID!] | Please provide one and only one valid domain uuid. |
dwId | UUID! | Warehouse UUID |
eventRollupCount | Int | The number of events to roll up into a single incident |
eventRollupUntilChanged | Boolean | If true, roll up events until the value changes |
exceptionPrimaryKeyColumn | String | Specifies the column which contains the primary key for sampled data used in exception management. |
failOnReset | Boolean | Return an error if the update is a significant change that would require a monitor reset. Default: false. |
failureAudiences | [String!] | The audiences to notify on failure |
fieldMetric | FieldMetricInput | (DEPRECATED). Use standard Custom SQL monitors instead. |
fieldQueryParameters | FieldQueryParametersInput | (DEPRECATED). Use Validation monitors instead for cardinality checks. |
intervalMinutes | Int | How often to run scheduled custom rule check (DEPRECATED, use schedule instead) |
labels | [String] | The monitor labels |
notes | String | Additional context for the monitor Default: "". |
notifyRuleRunFailure | Boolean | DEPRECATED: Completely ignored. This field has no effect on anything. Use failure_audiences to determine who is notified when run failures occur. |
priority | String | The default priority for alerts involving this monitor |
queryResultType | QueryResultType | How the query result is used for the metric. Uses row count if unset. |
queryTemplateId | String | (DEPRECATED). Use Validation monitors instead for referential integrity checks. |
queryTemplateVariableValues | [QueryTemplateVariableValueInput!] | (DEPRECATED). Use Validation monitors instead for referential integrity checks. |
scheduleConfig | ScheduleConfigInput | Schedule of custom rule |
severity | String | DEPRECATED. Use priority instead. The default severity for incidents involving this monitor Default: "". |
skipReset | Boolean | Do 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. |
startTime | DateTime | Start time of schedule (DEPRECATED, use schedule instead) |
tags | [TagKeyValuePairInput] | The monitor tags. |
timeout | Int | Timeout for the SQL query |
timezone | String | Timezone (DEPRECATED, use timezone in scheduleConfig instead |
variableDefinitions | [VariableDefinitionInput!] | Possible variable values for SQL query. Allows specifying runtime variables as well. |
variables | JSONString | Possible variable values for SQL query. Only to specify static variables. |
Returns
CreateOrUpdateCustomMetricRule
Example
mutation CreateOrUpdateCustomMetricRule($comparisons: [CustomRuleComparisonInput]!, $customSql: String!, $description: String!, $dwId: UUID!) {
createOrUpdateCustomMetricRule(comparisons: $comparisons, customSql: $customSql, description: $description, dwId: $dwId) {
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 createOrUpdateCustomMetricRule
createOrUpdateCustomMetricRuleCreateOrUpdateCustomMetricRule
CreateOrUpdateCustomMetricRuleObject type. Create or update a custom metric rule
| Field | Type | Description |
|---|---|---|
customRule | CustomRule |
Related types
AlertGroupingInput, AudienceConditionInput, CustomRule, CustomRuleComparisonInput, DateTime, FieldMetricInput, FieldQueryParametersInput, JSONString, QueryResultType, QueryTemplateVariableValueInput, ScheduleConfigInput, TagKeyValuePairInput, UUID, VariableDefinitionInput
createOrUpdateCustomRule (mutation)
createOrUpdateCustomRule 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: Deprecated: Depending on the type of monitor you would like to create, use CreateOrUpdateVolumeRule, CreateOrUpdateFreshnessCustomRule, CreateOrUpdateCustomSqlRule, CreateOrUpdateComparisonRule or CreateOrUpdateQueryPerfRule instead.
DEPRECATED. Depending on the type of monitor you would like to create, use CreateOrUpdateVolumeRule, CreateOrUpdateFreshnessCustomRule, CreateOrUpdateCustomSqlRule, CreateOrUpdateComparisonRule or CreateOrUpdateQueryPerfRule instead.
Arguments
| Argument | Type | Description |
|---|---|---|
alertGrouping | AlertGroupingInput | Per-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 |
customRuleUuid | UUID | UUID of custom rule, to update existing rule |
dataQualityDimension | String | Data quality dimension on the custom rule. |
description | String | Used as the name in the UI |
domainUuids | [UUID!] | Please provide one and only one valid domain uuid. |
dwId | UUID | Warehouse the tables are contained in. Required when using fullTableIds |
eventRollupCount | Int | The number of events to roll up into a single incident |
eventRollupUntilChanged | Boolean | If true, roll up events until the value changes |
exceptionPrimaryKeyColumn | String | Specifies the column which contains the primary key for sampled data used in exception management. |
failureAudiences | [String!] | The audiences to notify on failure |
intervalMinutes | Int | How often to run scheduled custom rule check (DEPRECATED, use schedule instead) |
labels | [String] | The monitor labels |
notes | String | Additional context for the monitor Default: "". |
notifyRuleRunFailure | Boolean | DEPRECATED: Completely ignored. This field has no effect on anything. Use failure_audiences to determine who is notified when run failures occur. |
priority | String | The default priority for alerts involving this monitor |
scheduleConfig | ScheduleConfigInput | Schedule of custom rule |
severity | String | DEPRECATED. Use priority instead. The default severity for incidents involving this monitor Default: "". |
startTime | DateTime | Start time of schedule (DEPRECATED, use schedule instead) |
tags | [TagKeyValuePairInput] | The monitor tags. |
timezone | String | Timezone (DEPRECATED, use timezone in scheduleConfig instead |
Returns
CreateOrUpdateCustomRule
Example
mutation CreateOrUpdateCustomRule($comparisons: [CustomRuleComparisonInput]!) {
createOrUpdateCustomRule(comparisons: $comparisons) {
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 createOrUpdateCustomRule
createOrUpdateCustomRuleCreateOrUpdateCustomRule
CreateOrUpdateCustomRuleObject type. DEPRECATED. Depending on the type of monitor you would like to create, use CreateOrUpdateVolumeRule, CreateOrUpdateFreshnessCustomRule, CreateOrUpdateCustomSqlRule, CreateOrUpdateComparisonRule or CreateOrUpdateQueryPerfRule instead.
| Field | Type | Description |
|---|---|---|
customRule | CustomRule |
Related types
AlertGroupingInput, AudienceConditionInput, CustomRule, CustomRuleComparisonInput, DateTime, ScheduleConfigInput, TagKeyValuePairInput, UUID
createOrUpdateCustomSqlRule (mutation)
createOrUpdateCustomSqlRule 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 custom SQL monitor
Arguments
| Argument | Type | Description |
|---|---|---|
alertCondition | CustomSqlRuleAlertConditionInput! | Alert condition. |
alertGrouping | AlertGroupingInput | Per-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 audiences |
autoTriage | Boolean | Per-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. |
autoTuning | Boolean | Per-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. |
connectionId | UUID | Specify a connection (e.g. query-engine) to use |
customSamplingSql | String | Custom sampling SQL query to run on breach |
dataQualityDimension | String | Data quality dimension of the monitor. |
description | String! | Used as the name in the UI |
domainUuids | [UUID!] | Please provide one and only one valid domain uuid. |
dryRun | Boolean | Dry run the monitor creation or update and return the MaC YAML and queries. Default: false. |
dwId | UUID! | Warehouse UUID |
eventRollupCount | Int | The number of events to roll up into a single incident |
eventRollupUntilChanged | Boolean | If true, roll up events until the value changes |
exceptionPrimaryKeyColumn | String | Column name to use as primary key for exception management. |
failOnReset | Boolean | Return an error if the update is a significant change that would require a monitor reset. Default: false. |
failureAudiences | [String!] | The monitor audiences to notify on failure |
isDraft | Boolean | Make target a draft monitor. Default: false. |
notes | String | Additional context for the monitor Default: "". |
notifyRuleRunFailure | Boolean | DEPRECATED: Completely ignored. This field has no effect on anything. Use failure_audiences to determine who is notified when run failures occur. |
priority | String | The default priority for alerts involving this monitor |
queryResultType | QueryResultType | How the query result is used for the metric. Uses row count if unset. |
scheduleConfig | ScheduleConfigInput! | Schedule of custom rule |
skipReset | Boolean | Do 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. |
sql | String! | Custom SQL query to run |
tags | [TagKeyValuePairInput!] | The monitor tags. |
timeout | Int | Timeout for the SQL query |
uuid | UUID | UUID of the rule, to update an existing rule |
variableDefinitions | [VariableDefinitionInput!] | Possible variable values for SQL query. Allows specifying runtime variables as well. |
variables | JSONString | Possible variable values for SQL query |
Returns
CreateOrUpdateCustomSqlRule
Example
mutation CreateOrUpdateCustomSqlRule($alertCondition: CustomSqlRuleAlertConditionInput!, $description: String!, $dwId: UUID!, $scheduleConfig: ScheduleConfigInput!, $sql: String!) {
createOrUpdateCustomSqlRule(alertCondition: $alertCondition, description: $description, dwId: $dwId, scheduleConfig: $scheduleConfig, sql: $sql) {
yaml
queries
persistBlockedBy
spendGuardrailMessage
}
}Types used only by createOrUpdateCustomSqlRule
createOrUpdateCustomSqlRuleCreateOrUpdateCustomSqlRule
CreateOrUpdateCustomSqlRuleObject type. Create or update a custom SQL rule
| Field | Type | Description |
|---|---|---|
customRule | CustomRule | |
yaml | String | |
queries | [String!] | SQL queries that will be run by the monitor on each execution. |
estimatedCredits | EstimatedCredits | Spec-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. |
persistBlockedBy | String | Set 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. |
spendGuardrailMessage | String | Set 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. |
CustomSqlRuleAlertConditionInput
CustomSqlRuleAlertConditionInputInput object type.
| Field | Type | Description |
|---|---|---|
type | ComparisonType! | Default: "THRESHOLD". |
operator | CustomRuleComparisonOperator! | Comparison operator |
threshold | Float | Threshold value |
isPercentageThreshold | Boolean | Evaluate the threshold as a percentage of a baseline query result. |
percentageBaselineSql | String | SQL query counting the population the monitor evaluates. Accepted on any threshold type; required for a percentage threshold. Send an empty string to clear a stored baseline. |
baselineAggFunction | AggregationFunction | Function used to aggregate historical data points to calculate baseline |
baselineIntervalMinutes | Int | Time interval to aggregate over to calculate baseline. |
isThresholdRelative | Boolean | True, if threshold is a relative percentage change of baseline. False, if threshold is absolute change |
thresholdSensitivity | SensitivityLevels | Sensitivity for automated thresholds |
upperThreshold | Float | Upper threshold value |
lowerThreshold | Float | Lower threshold value |
Related types
AggregationFunction, AlertGroupingInput, AudienceConditionInput, ComparisonType, CustomRule, CustomRuleComparisonOperator, EstimatedCredits, JSONString, QueryResultType, ScheduleConfigInput, SensitivityLevels, TagKeyValuePairInput, UUID, VariableDefinitionInput
createOrUpdateCustomSqlTemplate (mutation)
createOrUpdateCustomSqlTemplate 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 custom sql template
Arguments
| Argument | Type | Description |
|---|---|---|
description | String | Description of custom sql template |
dialect | String | Dialect of custom sql template |
name | String | Name of custom sql template |
queryResultType | QueryResultType | CustomSQLTemplate's query result type can be set to SINGLE_NUMERIC, ROW_COUNT and LABELED_NUMERICS. The result is ROW_COUNT if unset |
sqlTemplate | String! | SQL template of custom sql template |
uuid | UUID | UUID of custom sql template |
Returns
CreateOrUpdateCustomSQLTemplate
Example
mutation CreateOrUpdateCustomSqlTemplate($sqlTemplate: String!) {
createOrUpdateCustomSqlTemplate(sqlTemplate: $sqlTemplate) {
customSqlTemplate {
uuid
name
dialect
description
sqlTemplate
queryResultType
id
}
}
}Types used only by createOrUpdateCustomSqlTemplate
createOrUpdateCustomSqlTemplateCreateOrUpdateCustomSQLTemplate
CreateOrUpdateCustomSQLTemplateObject type.
| Field | Type | Description |
|---|---|---|
customSqlTemplate | CustomSQLTemplate |
Related types
CustomSQLTemplate, QueryResultType, UUID
Source: The GraphQL API reference
This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.
