Related queries and mutations in Alerts and incidents. Each has its own section.
Queries
detectTimeAxisIntrinsicDelta (query)
detectTimeAxisIntrinsicDelta is a query in the Monte Carlo GraphQL API, in Alerts and incidents. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Detects time delta between the selected time axis and intrinsic time
Arguments
| Argument | Type | Description |
|---|---|---|
mcon | String! | Default: "Table MCON". |
timeAxis | String! | Default: "Time axis field name". |
anchorEvent | UUID! | Default: "Anomaly event used for finding the time axis and intrinsic time overlap". |
Returns
TimeAxisDeltaDetectionResult
Example
query DetectTimeAxisIntrinsicDelta($mcon: String!, $timeAxis: String!, $anchorEvent: UUID!) {
detectTimeAxisIntrinsicDelta(mcon: $mcon, timeAxis: $timeAxis, anchorEvent: $anchorEvent) {
delta
}
}Types used only by detectTimeAxisIntrinsicDelta
detectTimeAxisIntrinsicDeltaTimeAxisDeltaDetectionResult
TimeAxisDeltaDetectionResultObject type.
| Field | Type | Description |
|---|---|---|
delta | Int | time delta between the time axis and intrinsic time |
Related types
getCorrelationSamplingMetadata (query)
getCorrelationSamplingMetadata is a query in the Monte Carlo GraphQL API, in Alerts and incidents. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Provides initial information for sampling requests (e.g. time axis candidates, explanatory fields, etc.
Arguments
| Argument | Type | Description |
|---|---|---|
mcon | String! | Default: "Table MCON". |
Returns
CorrelationSamplingMetadata
Example
query GetCorrelationSamplingMetadata($mcon: String!) {
getCorrelationSamplingMetadata(mcon: $mcon) {
timeAxis {
candidates
suggested
}
}
}Types used only by getCorrelationSamplingMetadata
getCorrelationSamplingMetadataCorrelationSamplingMetadata
CorrelationSamplingMetadataObject type.
| Field | Type | Description |
|---|---|---|
timeAxis | TimeAxisMetadata | Field used as the time axis |
explanatoryField | ExplanatoryFieldMetadata | Field from which values are sampled |
ExplanatoryFieldMetadata
ExplanatoryFieldMetadataObject type.
| Field | Type | Description |
|---|---|---|
candidates | [String] | Fields which can be used as explanatory |
TimeAxisMetadata
TimeAxisMetadataObject type.
| Field | Type | Description |
|---|---|---|
candidates | [String] | Fields which can be used as time axis |
suggested | String | Field most likely to be the time axis |
getFieldHealthSamplingConditions (query)
getFieldHealthSamplingConditions is a query in the Monte Carlo GraphQL API, in Alerts and incidents. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Returns the conditions that can be used for field health sampling
Arguments
| Argument | Type | Description |
|---|---|---|
eventUuid | UUID! | UUID of an event that contains field metric anomaly |
field | String | Anomalous field. This is required if the anomaly (metric type dependent) involves a field. |
metric | SamplingEnabledMetricTypes! | Metric type of the anomaly. |
Returns
FieldHealthSamplingConditionsResponse
Example
query GetFieldHealthSamplingConditions($eventUuid: UUID!, $metric: SamplingEnabledMetricTypes!) {
getFieldHealthSamplingConditions(eventUuid: $eventUuid, metric: $metric) {
conditions
}
}Types used only by getFieldHealthSamplingConditions
getFieldHealthSamplingConditionsFieldHealthSamplingConditionsResponse
FieldHealthSamplingConditionsResponseObject type.
| Field | Type | Description |
|---|---|---|
conditions | [String!] | List of conditions that can be used to construct sample query. |
Related types
SamplingEnabledMetricTypes, UUID
getRcaJobResult (query)
getRcaJobResult is a query in the Monte Carlo GraphQL API, in Alerts and incidents. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Arguments
| Argument | Type | Description |
|---|---|---|
jobUuid | UUID |
Returns
RcaResult
Example
query GetRcaJobResult {
getRcaJobResult {
status
jobType
}
}Types used only by getRcaJobResult
getRcaJobResultDataProfileField
DataProfileFieldObject type.
| Field | Type | Description |
|---|---|---|
name | String | |
type | String | |
min | Float | |
max | Float | |
p25 | Float | |
p50 | Float | |
p75 | Float | |
dist | JSONString |
DataProfileResult
DataProfileResultObject type.
| Field | Type | Description |
|---|---|---|
sampleSize | Int | |
fields | [DataProfileField] |
FHNumericRcaResult
FHNumericRcaResultObject type.
| Field | Type | Description |
|---|---|---|
rca | [FHNumericResult] |
FHNumericResult
FHNumericResultObject type.
| Field | Type | Description |
|---|---|---|
metricName | String | The metric which we ran the correlation for (i.e. mean, p80, etc.) |
metricFieldName | String | The name of the field we ran the correlation for |
explanatoryFieldName | String | The name of the column in which a value is correlated with the anomalous rows |
explanatoryFieldValue | String | The value correlated with the anomalous rows |
normalRowRatio | Float | The ratio of rows out of total rows for the explanatory value prior to the anomaly |
anomalousRowRatio | Float | The ratio of rows out of total rows for the explanatory value in the anomalous rows |
normalMetricValue | Float | The value of the relevant metric prior to the anomaly |
anomalousMetricValue | Float | The value of metric in the anomalous rows |
explainability1 | Float | Explainability 1 score |
explainability2 | Float | Explainability 2 score |
correlation | String | high or low correlation found on field |
FieldDistRcaData
FieldDistRcaDataObject type.
| Field | Type | Description |
|---|---|---|
timeField | String | Table field which serves as a time axis |
anomTime | DateTime | Time when the anomaly occurred |
explanatoryField | String | Table field containing the explanatory value |
val | String | Explanatory value used in the analysis |
FieldDistRcaResult
FieldDistRcaResultObject type.
| Field | Type | Description |
|---|---|---|
rca | [FieldDistRcaData] | |
plotData | [RcaPlotData] | |
lowCardFieldsWoRca | [String] | |
availableFields | [String] |
FieldValueCorrelation
FieldValueCorrelationObject type.
| Field | Type | Description |
|---|---|---|
field | String | |
value | String | |
normRate | Float | |
anomRate | Float |
MetricAnomalyCorrelation
MetricAnomalyCorrelationObject type.
| Field | Type | Description |
|---|---|---|
field | String | |
metric | String | |
correlations | [FieldValueCorrelation] |
MetricAnomalyCorrelationV2
MetricAnomalyCorrelationV2Object type.
| Field | Type | Description |
|---|---|---|
field | String | |
metric | String | |
data | [FieldValueCorrelation] | |
hasStrongCorrelations | Boolean |
MetricCorrelationResult
MetricCorrelationResultObject type.
| Field | Type | Description |
|---|---|---|
metricAnomalies | [MetricAnomalyCorrelation] | |
metricAnomaliesV2 | [MetricAnomalyCorrelationV2] |
NumericAnomalyCorrelation
NumericAnomalyCorrelationObject type.
| Field | Type | Description |
|---|---|---|
field | String | The name of the field we ran the correlation for |
metric | String | The metric for the field we ran the correlation for |
value | Float | The breach value |
historicalValue | Float | The historical value |
correlations | [FieldValueCorrelation] | The field/value pairs correlation with the breach |
outliers | NumericAnomalyOutliers | A list of rows that caused the breach |
NumericAnomalyOutliers
NumericAnomalyOutliersObject type.
| Field | Type | Description |
|---|---|---|
columns | [String] | |
rows | [[String]] |
NumericCorrelationRcaResult
NumericCorrelationRcaResultObject type.
| Field | Type | Description |
|---|---|---|
numericAnomalies | [NumericAnomalyCorrelation] |
RcaData
RcaDataUnion type.
One of: FieldDistRcaResult, DataProfileResult, MetricCorrelationResult, SQLQueryResult, FHNumericRcaResult, NumericCorrelationRcaResult
RcaResult
RcaResultObject type.
| Field | Type | Description |
|---|---|---|
status | RcaStatus | |
jobType | RcaJobsModelJobType! | |
statusReasons | [EventRcaStatusModelReason!] | |
rcaDataV2 | RcaData |
RcaStatus
RcaStatusEnum type.
| Value | Description |
|---|---|
FOUND | |
EMPTY | |
FAILED | |
CANCELED | |
EXPIRED | |
PARTIAL_DATA |
SQLQueryResult
SQLQueryResultObject type.
| Field | Type | Description |
|---|---|---|
columns | [String] | |
rows | [[String]] | |
matches | [ConditionMatches] | |
hasCustomSqlFilter | Boolean | True if the alert condition contains custom SQL expressions |
Related types
ConditionMatches, DateTime, EventRcaStatusModelReason, JSONString, RcaJobsModelJobType, RcaPlotData, UUID
performCorrelationSampling (query)
performCorrelationSampling is a query in the Monte Carlo GraphQL API, in Alerts and incidents. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Samples value distribution data alongside the time axis
Arguments
| Argument | Type | Description |
|---|---|---|
mcon | String! | MCON of the sampled table |
field | String! | Field to be sampled |
timeAxis | String! | Time axis field used for sampling |
startTime | DateTime! | Start time for sampling |
endTime | DateTime! | End time for sampling |
maxValues | Int | Maximum number of top values (the rest is aggregated in "others") Default: 5. |
maxRows | Int | Maximum number of rows returned Default: 1000. |
Returns
Example
query PerformCorrelationSampling($mcon: String!, $field: String!, $timeAxis: String!, $startTime: DateTime!, $endTime: DateTime!) {
performCorrelationSampling(mcon: $mcon, field: $field, timeAxis: $timeAxis, startTime: $startTime, endTime: $endTime) {
sample {
label
timestamp
value
}
}
}Related types
CorrelationSamplingResult, DateTime
performCorrelationSamplingWithTimeTravel (query)
performCorrelationSamplingWithTimeTravel is a query in the Monte Carlo GraphQL API, in Alerts and incidents. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Samples value distribution data alongside the time axis
Arguments
| Argument | Type | Description |
|---|---|---|
mcon | String! | MCON of the sampled table |
field | String! | Field to be sampled |
startTime | DateTime! | Start time for sampling |
endTime | DateTime! | End time for sampling |
maxValues | Int | Maximum number of top values (the rest is aggregated in "others") Default: 5. |
maxRows | Int | Maximum number of rows returned Default: 1000. |
Returns
Example
query PerformCorrelationSamplingWithTimeTravel($mcon: String!, $field: String!, $startTime: DateTime!, $endTime: DateTime!) {
performCorrelationSamplingWithTimeTravel(mcon: $mcon, field: $field, startTime: $startTime, endTime: $endTime) {
sample {
label
timestamp
value
}
}
}Related types
CorrelationSamplingResult, DateTime
performFieldHealthSampling (query)
performFieldHealthSampling is a query in the Monte Carlo GraphQL API, in Alerts and incidents. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Samples value distribution data alongside the time axis
Arguments
| Argument | Type | Description |
|---|---|---|
field | String! | Field to be sampled |
metric | String! | Metric to be sampled |
monitorUuid | UUID! | The Monitor UUID that monitors the field health |
startTime | DateTime! | Start time for sampling |
endTime | DateTime! | End time for sampling |
maxRows | Int | Maximum number of rows returned Default: 1000. |
eventUuid | UUID | Optional UUID of an event that contains field metric anomaly |
dryRun | Boolean | Defaults to true, only fetch the query, do not run |
Returns
FieldHealthSampling
Example
query PerformFieldHealthSampling($field: String!, $metric: String!, $monitorUuid: UUID!, $startTime: DateTime!, $endTime: DateTime!) {
performFieldHealthSampling(field: $field, metric: $metric, monitorUuid: $monitorUuid, startTime: $startTime, endTime: $endTime) {
columns
rows
hasCustomSqlFilter
samplingDisabled
nextFileIndex
totalSamplesSize
branchSampleCounts
branchMatches
normalRecordsQuery
anomalousRecordsQuery
}
}Types used only by performFieldHealthSampling
performFieldHealthSamplingFieldHealthSampling
FieldHealthSamplingObject type.
| Field | Type | Description |
|---|---|---|
columns | [String] | |
rows | [[String]] | |
matches | [ConditionMatches] | |
hasCustomSqlFilter | Boolean | True if the alert condition contains custom SQL expressions |
samplingDisabled | Boolean | |
nextFileIndex | Int | Next file index to retrieve. |
totalSamplesSize | Int | Total number of samples retrieved. |
branchSampleCounts | JSONString | Per-branch breach counts over the drawn sample row set. Keys are branch metric names matching conditionBreakdown entry names; values are the number of sample rows where that branch predicate evaluated to true. Null when the sample does not carry per-branch indicator data (non-multi-condition monitors or monitors without sampling enabled). |
branchMatches | JSONString | Per-branch row indices into the drawn sample. Keys are branch metric names (matching conditionBreakdown entry names); values are arrays of 0-based row indices from rows where that branch predicate evaluated to true. Use this to filter the sample drawer to only rows matching a selected condition. Null when the sample does not carry per-branch indicator data. |
normalRecordsQuery | String | This is null for summary statistics such as mean, min, max, and percentiles |
anomalousRecordsQuery | String |
Related types
ConditionMatches, DateTime, JSONString, UUID
performFieldHealthSamplingV2 (query)
performFieldHealthSamplingV2 is a query in the Monte Carlo GraphQL API, in Alerts and incidents. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Samples value distribution data alongside the time axis
Arguments
| Argument | Type | Description |
|---|---|---|
eventUuid | UUID | Optional UUID of an event that contains field metric anomaly |
field | String! | Field to be sampled |
metric | String! | Metric to be sampled |
maxRows | Int | Maximum number of rows returned Default: 1000. |
dryRun | Boolean | Defaults to false, only fetch the query, do not run Default: false. |
Returns
Example
query PerformFieldHealthSamplingV2($field: String!, $metric: String!) {
performFieldHealthSamplingV2(field: $field, metric: $metric) {
columns
rows
hasCustomSqlFilter
query
hasError
error
samplingDisabled
samplingRestricted
contentWithheldReason
rateLimitExceeded
idempotentStatus
downloadUrl
queryExecutionId
}
}Related types
performFieldHealthSamplingV3 (query)
performFieldHealthSamplingV3 is a query in the Monte Carlo GraphQL API, in Alerts and incidents. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.
Status: Experimental
Construct or run a query to sample data based on a field metric anomaly
Arguments
| Argument | Type | Description |
|---|---|---|
eventUuid | UUID! | UUID of an event that contains field metric anomaly |
field | String | Anomalous field. This is required if the anomaly (metric type dependent) involves a field. |
metric | SamplingEnabledMetricTypes! | Metric type of the anomaly. |
condition | String | Condition to be used for sampling. Only exact results from getFieldHealthSamplingConditions API response are accepted. |
segmentBy | String | Table field to be used to group results. |
maxRows | Int | Maximum number of rows returned Default: 1000. |
dryRun | Boolean | Defaults to false, only fetch the query, do not run Default: true. |
returnTotalCount | Boolean | Returns the total count of rows from the sampling query Default: false. |
rowSamplingConfig | MonitorSamplingConfigInput | Sampling configuration to only read a subset of the data |
includeExplanation | Boolean | Include the explanation field in the results (only supported for monitors with LLM evaluations, e.g. agent monitors and metric monitors with eval_prompt). Combined with useAlertSample=true, the explanation is a stored-column read wherever the persisted sample recorded the judge reasoning (conversation-aggregation ClickHouse alerts and platform-agent alerts, per Event.hasAlertSampleExplanation); on ClickHouse span-grain alerts it instead re-evaluates the alert's exact spans (a fresh judge call) and grafts the alert's stored score as alertScore. Default: false. |
useAlertSample | Boolean | When true, return the sample stored when the alert fired — the exact spans and scores it evaluated — instead of taking a fresh sample. Alerts whose Event.hasAlertSample is true have such a stored sample. If no stored sample exists or it is no longer available, the request fails with ALERT_SAMPLE_UNAVAILABLE rather than substituting a different sample. When false (default), a new sample is taken. Default: false. |
Returns
Example
query PerformFieldHealthSamplingV3($eventUuid: UUID!, $metric: SamplingEnabledMetricTypes!) {
performFieldHealthSamplingV3(eventUuid: $eventUuid, metric: $metric) {
columns
rows
hasCustomSqlFilter
query
hasError
error
samplingDisabled
samplingRestricted
contentWithheldReason
rateLimitExceeded
idempotentStatus
downloadUrl
queryExecutionId
}
}Related types
MonitorSamplingConfigInput, SQLResponse, SamplingEnabledMetricTypes, UUID
Source: The GraphQL API reference
This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.
