Root cause analysis (GraphQL)

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

ArgumentTypeDescription
mconString!Default: "Table MCON".
timeAxisString!Default: "Time axis field name".
anchorEventUUID!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

TimeAxisDeltaDetectionResult

Object type.

FieldTypeDescription
deltaInttime delta between the time axis and intrinsic time

Related types

UUID

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

ArgumentTypeDescription
mconString!Default: "Table MCON".

Returns

CorrelationSamplingMetadata

Example

query GetCorrelationSamplingMetadata($mcon: String!) {
  getCorrelationSamplingMetadata(mcon: $mcon) {
    timeAxis {
      candidates
      suggested
    }
  }
}

Types used only by getCorrelationSamplingMetadata

CorrelationSamplingMetadata

Object type.

FieldTypeDescription
timeAxisTimeAxisMetadataField used as the time axis
explanatoryFieldExplanatoryFieldMetadataField from which values are sampled
ExplanatoryFieldMetadata

Object type.

FieldTypeDescription
candidates[String]Fields which can be used as explanatory
TimeAxisMetadata

Object type.

FieldTypeDescription
candidates[String]Fields which can be used as time axis
suggestedStringField 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

ArgumentTypeDescription
eventUuidUUID!UUID of an event that contains field metric anomaly
fieldStringAnomalous field. This is required if the anomaly (metric type dependent) involves a field.
metricSamplingEnabledMetricTypes!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

FieldHealthSamplingConditionsResponse

Object type.

FieldTypeDescription
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

ArgumentTypeDescription
jobUuidUUID

Returns

RcaResult

Example

query GetRcaJobResult {
  getRcaJobResult {
    status
    jobType
  }
}

Types used only by getRcaJobResult

DataProfileField

Object type.

FieldTypeDescription
nameString
typeString
minFloat
maxFloat
p25Float
p50Float
p75Float
distJSONString
DataProfileResult

Object type.

FieldTypeDescription
sampleSizeInt
fields[DataProfileField]
FHNumericRcaResult

Object type.

FieldTypeDescription
rca[FHNumericResult]
FHNumericResult

Object type.

FieldTypeDescription
metricNameStringThe metric which we ran the correlation for (i.e. mean, p80, etc.)
metricFieldNameStringThe name of the field we ran the correlation for
explanatoryFieldNameStringThe name of the column in which a value is correlated with the anomalous rows
explanatoryFieldValueStringThe value correlated with the anomalous rows
normalRowRatioFloatThe ratio of rows out of total rows for the explanatory value prior to the anomaly
anomalousRowRatioFloatThe ratio of rows out of total rows for the explanatory value in the anomalous rows
normalMetricValueFloatThe value of the relevant metric prior to the anomaly
anomalousMetricValueFloatThe value of metric in the anomalous rows
explainability1FloatExplainability 1 score
explainability2FloatExplainability 2 score
correlationStringhigh or low correlation found on field
FieldDistRcaData

Object type.

FieldTypeDescription
timeFieldStringTable field which serves as a time axis
anomTimeDateTimeTime when the anomaly occurred
explanatoryFieldStringTable field containing the explanatory value
valStringExplanatory value used in the analysis
FieldDistRcaResult

Object type.

FieldTypeDescription
rca[FieldDistRcaData]
plotData[RcaPlotData]
lowCardFieldsWoRca[String]
availableFields[String]
FieldValueCorrelation

Object type.

FieldTypeDescription
fieldString
valueString
normRateFloat
anomRateFloat
MetricAnomalyCorrelation

Object type.

FieldTypeDescription
fieldString
metricString
correlations[FieldValueCorrelation]
MetricAnomalyCorrelationV2

Object type.

FieldTypeDescription
fieldString
metricString
data[FieldValueCorrelation]
hasStrongCorrelationsBoolean
MetricCorrelationResult

Object type.

FieldTypeDescription
metricAnomalies[MetricAnomalyCorrelation]
metricAnomaliesV2[MetricAnomalyCorrelationV2]
NumericAnomalyCorrelation

Object type.

FieldTypeDescription
fieldStringThe name of the field we ran the correlation for
metricStringThe metric for the field we ran the correlation for
valueFloatThe breach value
historicalValueFloatThe historical value
correlations[FieldValueCorrelation]The field/value pairs correlation with the breach
outliersNumericAnomalyOutliersA list of rows that caused the breach
NumericAnomalyOutliers

Object type.

FieldTypeDescription
columns[String]
rows[[String]]
NumericCorrelationRcaResult

Object type.

FieldTypeDescription
numericAnomalies[NumericAnomalyCorrelation]
RcaData

Union type.

One of: FieldDistRcaResult, DataProfileResult, MetricCorrelationResult, SQLQueryResult, FHNumericRcaResult, NumericCorrelationRcaResult

RcaResult

Object type.

FieldTypeDescription
statusRcaStatus
jobTypeRcaJobsModelJobType!
statusReasons[EventRcaStatusModelReason!]
rcaDataV2RcaData
RcaStatus

Enum type.

ValueDescription
FOUND
EMPTY
FAILED
CANCELED
EXPIRED
PARTIAL_DATA
SQLQueryResult

Object type.

FieldTypeDescription
columns[String]
rows[[String]]
matches[ConditionMatches]
hasCustomSqlFilterBooleanTrue 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

ArgumentTypeDescription
mconString!MCON of the sampled table
fieldString!Field to be sampled
timeAxisString!Time axis field used for sampling
startTimeDateTime!Start time for sampling
endTimeDateTime!End time for sampling
maxValuesIntMaximum number of top values (the rest is aggregated in "others") Default: 5.
maxRowsIntMaximum number of rows returned Default: 1000.

Returns

CorrelationSamplingResult

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

ArgumentTypeDescription
mconString!MCON of the sampled table
fieldString!Field to be sampled
startTimeDateTime!Start time for sampling
endTimeDateTime!End time for sampling
maxValuesIntMaximum number of top values (the rest is aggregated in "others") Default: 5.
maxRowsIntMaximum number of rows returned Default: 1000.

Returns

CorrelationSamplingResult

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

ArgumentTypeDescription
fieldString!Field to be sampled
metricString!Metric to be sampled
monitorUuidUUID!The Monitor UUID that monitors the field health
startTimeDateTime!Start time for sampling
endTimeDateTime!End time for sampling
maxRowsIntMaximum number of rows returned Default: 1000.
eventUuidUUIDOptional UUID of an event that contains field metric anomaly
dryRunBooleanDefaults 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

FieldHealthSampling

Object type.

FieldTypeDescription
columns[String]
rows[[String]]
matches[ConditionMatches]
hasCustomSqlFilterBooleanTrue if the alert condition contains custom SQL expressions
samplingDisabledBoolean
nextFileIndexIntNext file index to retrieve.
totalSamplesSizeIntTotal number of samples retrieved.
branchSampleCountsJSONStringPer-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).
branchMatchesJSONStringPer-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.
normalRecordsQueryStringThis is null for summary statistics such as mean, min, max, and percentiles
anomalousRecordsQueryString

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

ArgumentTypeDescription
eventUuidUUIDOptional UUID of an event that contains field metric anomaly
fieldString!Field to be sampled
metricString!Metric to be sampled
maxRowsIntMaximum number of rows returned Default: 1000.
dryRunBooleanDefaults to false, only fetch the query, do not run Default: false.

Returns

SQLResponse

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

SQLResponse, UUID

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

ArgumentTypeDescription
eventUuidUUID!UUID of an event that contains field metric anomaly
fieldStringAnomalous field. This is required if the anomaly (metric type dependent) involves a field.
metricSamplingEnabledMetricTypes!Metric type of the anomaly.
conditionStringCondition to be used for sampling. Only exact results from getFieldHealthSamplingConditions API response are accepted.
segmentByStringTable field to be used to group results.
maxRowsIntMaximum number of rows returned Default: 1000.
dryRunBooleanDefaults to false, only fetch the query, do not run Default: true.
returnTotalCountBooleanReturns the total count of rows from the sampling query Default: false.
rowSamplingConfigMonitorSamplingConfigInputSampling configuration to only read a subset of the data
includeExplanationBooleanInclude 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.
useAlertSampleBooleanWhen 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

SQLResponse

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.