Query performance (GraphQL)

Related queries and mutations in Performance and cost. Each has its own section.

Queries

getAgentCostFindings (query)

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

Status: Experimental

The account's latest weekly cost findings for an agent's digest: table and job findings in a domain, warehouse settings account-wide, merged by overlap group, with totals computed in code and what is new since the last digest. Reads only accounts on the version 2 findings flow. The steps run in this order: the account's scope and the domain, the domain's dismissed findings, rank, the repeat rule (with 'since'), section caps, free tier, 'stableKey'. The domain's dismissals apply to 'domainId', or without it to a caller with one accessible domain.

Arguments

ArgumentTypeDescription
domainIdUUIDKeep the table and job findings in this domain. Without it, a domain-restricted caller gets those in its accessible domains.
sinceDateTimeWhen the last digest was made. A finding is new when the newest run that ended by then did not have it. With it, new items come first, and a still-open item repeats only in its section's top 3 or once every 4 weeks. Without it, every finding is new.
stableKeyStringRead only the item holding this finding. A paid account finds any item, the ones the section caps or the repeat rule left out included. The free tier finds only its one item; any other key returns no item. A dismissed finding is not found.

Returns

AgentCostFindingsOutput!

Example

query GetAgentCostFindings {
  getAgentCostFindings {
    availability
    reason
    domainMoreCount
    accountMoreCount
    hiddenCount
    upgradeRequired
    upgradeReason
    upgradeUrl
    hasNewRun
    runThreadId
    runStartedAt
    runEndedAt
    latestRunFailed
  }
}

Types used only by getAgentCostFindings

AgentCostFindingSection

Enum type. Where a digest item belongs: a domain's own findings, or the account's.

ValueDescription
DOMAIN
ACCOUNT
AgentCostFindingsAvailability

Enum type. Whether the account's cost findings can be read, and why not.

ValueDescription
AVAILABLE
PIPELINE_OFF
NO_RUN_YET
NOT_ON_V2
FETCH_FAILED
AgentCostFindingsOutput

Object type. The account's latest cost findings, shaped for an agent's digest.

FieldTypeDescription
availabilityAgentCostFindingsAvailability!AVAILABLE: the findings are in 'items'. PIPELINE_OFF and NOT_ON_V2 are permanent until the account changes (NOT_ON_V2: the newest run has no version 2 result: an older flow, or an unknown version; a shadow run's version 2 result counts). NO_RUN_YET and FETCH_FAILED are transient: try again later.
reasonStringWhy the findings are not available. Null when they are.
items[AgentCostItemOutput!]!Findings that a Teammate memory of the domain dismissed are left out. Ranked: a shown saving first, largest first. Items whose saving is withheld follow, by the share of their work that the evidence shows is waste. Ties go to more runs, then a key asset or higher importance score for the output table, then the larger warehouse spend, then the stable key. With 'since', new items come first. A still-open item below its section's top 3 is then kept only once every 4 weeks. Then at most 5 DOMAIN and 3 ACCOUNT items are kept, in that order. The free tier keeps only the first item of both sections.
totalsAgentCostTotalsOutput!Totals over the items returned. Items the caps, the repeat rule or the free tier left out are not counted.
domainTotalsAgentCostTotalsOutput!Totals over the DOMAIN items returned.
accountTotalsAgentCostTotalsOutput!Totals over the ACCOUNT (warehouse setting) items returned.
warehouses[CostFindingWarehouseOutput!]!The warehouses the items returned name, each once.
domainMoreCountInt!DOMAIN items the cap of 5 left out; the Performance page lists them. Items the repeat rule held back are not counted. 0 on the free tier and on a 'stableKey' read.
accountMoreCountInt!ACCOUNT items the cap of 3 left out; the Performance page lists them. Items the repeat rule held back are not counted. 0 on the free tier and on a 'stableKey' read.
hiddenCountInt!How many items the account's free tier does not show. Items the repeat rule held back are not counted.
upgradeRequiredBoolean!Whether items are hidden until the account upgrades.
upgradeReasonStringWhat to tell the account when items are hidden.
upgradeUrlStringThe absolute URL of the cost agent's settings page, where the account can upgrade. Null when 'upgradeRequired' is false.
lostAnalyses[CostFindingLostAnalysisOutput!]!Analyses the run could not do, within the account's scope: not checked.
hasNewRunBoolean!False when no run ended after 'since': every finding is still open.
runThreadIdStringThe run the findings were read from.
runStartedAtDateTimeWhen the run the findings came from started.
runEndedAtDateTimeWhen that run ended. Null when it recorded no end time.
latestRunFailedBoolean!The newest run failed, so these are the newest earlier run's findings.
AgentCostItemOutput

Object type. One digest line: the findings of one overlap group, which act on the same table, warehouse or job.

FieldTypeDescription
sectionAgentCostFindingSection!DOMAIN for table and job findings, ACCOUNT for warehouse settings.
overlapGroupString!The group the findings share: they act on the same table, warehouse or job.
stableKeys[String!]!The stable keys of the item's findings, to match them across runs.
isNewBoolean!Whether any of its findings is new since the last digest.
stillOpenSinceDateTimeFor an item still open since the last digest: when the oldest run in a row that has it started, the run read included. Null for a new item, without 'since', and on a 'stableKey' read.
stillOpenSinceBeforeBoolean!True when the item was open before 'stillOpenSince': the oldest run read still had it, or an earlier run couldn't be read.
savingUsdFloatThe group's largest shown saving a month. Null when every one is withheld.
findings[CostFindingOutput!]!The findings of the overlap group.
warehouses[CostFindingWarehouseOutput!]!The warehouses the item's findings name.
AgentCostTotalsOutput

Object type. Totals computed in code over the items returned.

FieldTypeDescription
savingUsdFloatThe sum of the items' shown savings a month. Each item is one overlap group, so no saving counts twice. Null when no item shows a saving.
warehousesUsdPerMonthFloatThe measured monthly spend of the warehouses the items name, each counted once. Null when none is known.
CostFindingWarehouseOutput

Object type. A platform warehouse the findings name, and what the whole warehouse costs a month.

FieldTypeDescription
platformString!The platform, lowercase.
platformAccountStringThe Snowflake account, when known.
warehouseIdString!The platform's warehouse ID.
nameStringThe warehouse's name on the platform, when known.
reportedBy[UUID!]!UUIDs of the Monte Carlo warehouses that report it.
usdPerMonthFloatThe whole warehouse's measured compute spend a month, all its work. Null when unknown; 'withheld' then says why.
withheldCostFindingWithheldFigureOutputWhy 'usdPerMonth' is null.

Related types

CostFindingLostAnalysisOutput, CostFindingOutput, CostFindingWithheldFigureOutput, DateTime, UUID

getCostKeyFindings (query)

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

Status: General availability

The account's Key findings: the cost findings the Key findings tab shows now, in the same order. A finding keeps its 'stableKey' from one analysis to the next, so automation can open, update and close one ticket per finding. Requires the Cost & Performance permission, and AI features enabled for the account. A domain-restricted caller gets the table and job findings in its domains, and every warehouse finding. On the free tier, only the finding with the largest saving is returned, without its change label. No findings and a null 'asOfTime' when cost insights aren't on for the account, or the latest analysis finished more than 30 days ago. Fails with COST_KEY_FINDINGS_NOT_SUPPORTED when the account's Key findings don't have stable keys yet, and with COST_KEY_FINDINGS_UNAVAILABLE when they can't be read right now; try again later.

Returns

CostKeyFindings!

Example

query GetCostKeyFindings {
  getCostKeyFindings {
    asOfTime
  }
}

Types used only by getCostKeyFindings

CostKeyFindings

Object type. The cost findings the Key findings tab shows, and the analyses the run couldn't do.

FieldTypeDescription
asOfTimeDateTimeThe end of the data the findings were computed from. It changes when a newer analysis replaces the list. Null when there is no analysis to read. Then 'findings' is empty and says nothing about whether findings were fixed.
findings[CostFindingOutput!]!The findings, in the order the Key findings tab shows them. Use 'stableKey' to recognize a finding across reads, and 'earlierKeys' after its 'keyVersion' changes.
lostAnalyses[CostFindingLostAnalysisOutput!]!Analyses that couldn't run for a fix type on some warehouses. A finding of that fix type on those warehouses can be missing from 'findings' because its analysis didn't run, not because the problem went away.

Related types

CostFindingLostAnalysisOutput, CostFindingOutput, DateTime

getIndexedFieldSpecs (query)

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

Arguments

ArgumentTypeDescription
includedFacetsTypes[DashboardType]Facet types to include in the results. Can be READ, WRITE or both. By default it will use WRITE

Returns

[IndexedFieldSpecType]

Example

query GetIndexedFieldSpecs {
  getIndexedFieldSpecs {
    fieldName
    displayName
    displayable
    aggregatable
    facetable
    filterable
    facetSearchable
    dashboardTypes
  }
}

Types used only by getIndexedFieldSpecs

DashboardType

Enum type.

ValueDescription
READ
WRITE
IndexedFieldSpecType

Object type.

FieldTypeDescription
fieldNameString
displayNameString
displayableBoolean
aggregatableBoolean
facetableBoolean
filterableBoolean
facetSearchableBoolean
dashboardTypes[DashboardType]

getPerformancePageInsights (query)

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

Status: Experimental

Cost insights for the caller's account, shown on the Performance Page: whether the feature is enabled and the insights of the latest completed run, or of the newest earlier one that succeeded when that run failed.

Arguments

ArgumentTypeDescription
mcInternalViewBooleanTemporary, for Monte Carlo internal use only. For any other caller it has no effect. Default: false.

Returns

PerformancePageInsightsOutput!

Example

query GetPerformancePageInsights {
  getPerformancePageInsights {
    isEnabled
    disabledReason
    insightsCount
    threadId
    createdTime
    contractVersion
    latestRunFailed
  }
}

Types used only by getPerformancePageInsights

AssumedCreditRateOutput

Object type. The per-credit rate a Snowflake compute figure's dollars were priced at.

FieldTypeDescription
amountFloat!Dollars per credit.
currencyString!ISO currency code of the amount, e.g. 'USD'.
unitString!Unit of 'amount', always 'USD/credit'.
CostFindingDisappearedOutput

Object type. A finding the previous cost insights run had and this run does not.

FieldTypeDescription
fixTypeCostFindingFixType!
warehouseUuids[UUID!]!UUIDs of every warehouse that reported what the finding targeted.
targets[CostFindingTargetOutput!]!
stableKeyString!The finding's key, in the current run's 'keyVersion'.
keyVersionInt!
findingCostFindingOutputThe finding as the previous run showed it. Its 'change' is null. Null on runs from before the field existed.
tickets[PerformanceInsightTicket!]!Tickets filed on this finding in an earlier run, oldest first. They show here while the finding is gone, and on the finding again if it comes back.
CostFindingPreviousRunOutput

Object type. The run a cost insights run's findings were compared with.

FieldTypeDescription
statusCostFindingPreviousRunStatus!
threadIdStringIdentifier of the run compared with. Set when 'status' is 'COMPARED'.
CostFindingPreviousRunStatus

Enum type. Whether a run's findings were compared with the previous run.

ValueDescription
COMPAREDCompared with the previous run.
NO_PREVIOUS_RUNNo previous run to compare with.
UNAVAILABLEThe previous run couldn't be read, or every recent run failed.
CostInsightsShadowRunOutput

Object type. Temporary, for Monte Carlo internal use only.

FieldTypeDescription
statusCostInsightsShadowRunStatus!
failureReasonStringWhy the new pipeline stored no findings. Set only when status is FAILED.
failedStepStringThe step the new pipeline failed at. Set only when status is FAILED.
contractVersionInt
insights[PerformancePageInsightOutput!]!
insightsCountInt!Total number of insights the shadow run produced in the account's scope, whether or not the account's tier lets it see them all. On the free tier it can exceed the number in 'insights'.
lostAnalyses[CostFindingLostAnalysisOutput!]!
previousRunCostFindingPreviousRunOutput
disappearedFindings[CostFindingDisappearedOutput!]!
CostInsightsShadowRunStatus

Enum type. Whether the shown run kept a new-pipeline result, and if so whether it is readable.

ValueDescription
COMPLETEDThe run stored the new pipeline's findings.
FAILEDThe new pipeline ran and stored no findings.
NO_SHADOW_RUNThe run shown didn't run the new pipeline.
UNAVAILABLEThe run couldn't be read.
EstimatedCostOutput

Object type. An estimate of what an insight's flagged workload spends today. This is current spend, not a saving: acting on the insight reduces it by an unknown amount. It is estimated from observed usage priced at the warehouse's rates, so it will not match a bill.

FieldTypeDescription
amountFloat!Estimated current spend, per 'period'.
currencyString!ISO currency code of the amount, e.g. 'USD'.
periodString!Period the cost is expressed over, e.g. 'month'.
EstimatedCreditsOutput

Object type. A Snowflake compute figure in credits, the unit its formula is written in. The credits counterpart of 'EstimatedSavingsOutput' / 'EstimatedCostOutput': the same figure, before it is priced into dollars.

FieldTypeDescription
amountFloat!Credits, per 'period'.
unitString!Unit of 'amount', always 'credits'.
periodString!Period the figure is expressed over, e.g. 'month'.
EstimatedSavingsOutput

Object type. An estimated monetary saving for an insight.

FieldTypeDescription
amountFloat!Estimated saving amount, per 'period'.
currencyString!ISO currency code of the amount, e.g. 'USD'.
periodString!Period the saving is expressed over, e.g. 'month'.
InsightImpactOutput

Object type. An insight's headline impact in its native, non-dollar unit.

FieldTypeDescription
kindPerformanceInsightImpactKind!Whether the impact is reclaimable storage or recurring compute time.
valueFloat!Impact quantity, in 'unit' over 'period'.
unitString!Unit of 'value': 'mb', 'gb' or 'tb' for storage; 'seconds', 'minutes' or 'hours' for time. Normalize across units before comparing or aggregating.
periodString!Period 'value' is expressed over, e.g. 'month'.
PerformanceInsightCategory

Enum type. Finding type of a cost/performance insight.

ValueDescription
READ
WRITE
STORAGE
RUNTIME
PerformanceInsightImpactKind

Enum type. Dimension a cost/performance insight's headline impact is measured in.

ValueDescription
STORAGE
TIME
PerformancePageInsightOutput

Object type. A single insight surfaced on the Performance Page.

FieldTypeDescription
keyString!Identifies this insight within the run that produced it, so a ticket can be filed against it. Only meaningful alongside that run's 'threadId'.
titleString!Full insight title, as a sentence.
headlineStringShort, scannable version of the title for card display. Null when the run did not produce one.
categoryPerformanceInsightCategoryFinding type of the insight. Null when the insight has no single applicable category.
contentString!Insight body.
relatedMcons[String!]!MCONs of the catalog objects this insight references.
relatedWarehouses[UUID!]!UUIDs of the warehouses this insight references.
estimatedSavingsEstimatedSavingsOutputEstimated cost saving if the insight's recommendation is acted on. Null when the insight has no quantifiable saving.
estimatedCostEstimatedCostOutputEstimated spend on the insight's flagged workload today, priced from its observed usage and the warehouse's rates. Distinct from 'estimatedSavings': acting on the insight reduces this spend by an amount that is often not predictable, so label it as estimated cost rather than savings. Null when no rate could price the workload, and for storage cleanup, where the estimated spend on the tables to remove already equals 'estimatedSavings'.
estimatedSavingsCreditsEstimatedCreditsOutput'estimatedSavings' before it was priced into dollars. Null whenever 'estimatedSavings' is, and for a run predating this field.
estimatedCostCreditsEstimatedCreditsOutput'estimatedCost' before it was priced into dollars. Null whenever 'estimatedCost' is, and for a run predating this field.
assumedCreditRateAssumedCreditRateOutputThe rate 'estimatedSavingsCredits' / 'estimatedCostCredits' were priced at. Null unless at least one of them is set.
impactInsightImpactOutputThe insight's headline impact in its native unit (reclaimable storage or recurring compute time). Null when the insight has no storage- or time-based quantity; the dollar figures are on 'estimatedSavings' and 'estimatedCost'.
tickets[PerformanceInsightTicket!]!Tickets already created for this insight, oldest first on a version 2 run. Empty when none have been filed. On a version 1 run, tickets are scoped to the run, so a new run starts with none. On a version 2 run, a ticket shows on the finding with the same stable key in every run.
findingCostFindingOutputThe insight as a finding with its figures and how they were calculated. Set when the run's 'contractVersion' is 2, and then the version 1 fields are empty (blank text, empty lists and nulls). 'key' and 'tickets' are still set. Null for a version 1 run.
PerformancePageInsightsOutput

Object type. Cost insights surfaced on the Performance Page.

FieldTypeDescription
isEnabledBoolean!Whether cost insights are fully enabled for the caller's account. False when the account no longer has access to them, and while it has none yet; 'disabledReason' tells the two apart.
disabledReasonStringWhen the account has insights it cannot see in full, this shows the reason why they are disabled. Null when the account simply has none yet.
spendGuardrailReachedSpendGuardrailReachedThe account spend guardrail that holds an account on the paid tier to the free tier until it resets. Null when no guardrail does.
insights[PerformancePageInsightOutput!]!Insights from the run shown for the caller's account, limited to what the account has access to. The run shown is the latest completed cost-insights run, or the newest earlier one that succeeded when 'latestRunFailed' is true. Empty until a run has produced insights.
insightsCountInt!Total number of insights the run shown produced in the account's scope, whether or not the account's tier lets it see them all. On the free tier it can exceed the number in 'insights'.
threadIdStringIdentifier of the run that produced these insights. Null when insights are unavailable for the caller's account.
createdTimeDateTimeWhen the run that produced these insights started. Null when insights are unavailable for the caller's account.
contractVersionIntWhich shape the run's insights take. Version 1 fills the insight fields; version 2 fills each insight's 'finding'. Null when insights are unavailable for the caller's account, or the run's shape is not one of these.
lostAnalyses[CostFindingLostAnalysisOutput!]!Analyses the run could not do, by warehouse, limited to what the account has access to. Empty for a version 1 run.
previousRunCostFindingPreviousRunOutputWhether the run's findings were compared with an earlier run. Null for a version 1 run, a result that doesn't say, and when insights are unavailable for the caller's account.
disappearedFindings[CostFindingDisappearedOutput!]!Findings the earlier run had and this run does not, limited to what the account has access to. Empty for a version 1 run, and when the account does not have the Performance & Cost agent feature enabled.
latestRunFailedBoolean!True when the account's latest run was a new-flow run that failed and stored no findings. The insights then come from the newest earlier run that succeeded, and 'createdTime' is when that run started. With no such run, 'insights' is empty. False for a failed old-flow run, which is shown as it is.
shadowRunCostInsightsShadowRunOutputTemporary, for Monte Carlo internal use only. The new pipeline's findings from a shadow run, which customers don't see. Null for any other caller.
SpendGuardrailReached

Object type. A spend guardrail that is reached, and when its period starts over.

FieldTypeDescription
scopeSpendGuardrailScope!
amountInt!The guardrail's limit, in unit.
spentFloat!What the guardrail's scope spent this period, in unit.
unitSpendUnit!The unit amount and spent are in.
resetTimeDateTime!When the period ends and spend starts again from zero.

Related types

CostFindingFixType, CostFindingLostAnalysisOutput, CostFindingOutput, CostFindingTargetOutput, DateTime, PerformanceInsightTicket, SpendGuardrailScope, SpendUnit, UUID

getQueryLogs (query)

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

Arguments

ArgumentTypeDescription
requestQueryLogsRequestInput!

Returns

QueryLogsResponseType

Example

query GetQueryLogs($request: QueryLogsRequestInput!) {
  getQueryLogs(request: $request) {
    total
  }
}

Types used only by getQueryLogs

QueryLogsResponseType

Object type.

FieldTypeDescription
totalInt!
results[QueryLogResultType]!

Related types

QueryLogResultType, QueryLogsRequestInput

getQueryLogsFacets (query)

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

Arguments

ArgumentTypeDescription
requestQueryLogsFacetRequestType!

Returns

QueryLogsFacetResponseType

Example

query GetQueryLogsFacets($request: QueryLogsFacetRequestType!) {
  getQueryLogsFacets(request: $request) {
    fieldName
  }
}

Related types

QueryLogsFacetRequestType, QueryLogsFacetResponseType

getQueryLogsFacetsV2 (query)

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

Arguments

ArgumentTypeDescription
requestQueryLogsFacetRequestTypeV2!

Returns

[QueryLogsFacetResponseType]

Example

query GetQueryLogsFacetsV2($request: QueryLogsFacetRequestTypeV2!) {
  getQueryLogsFacetsV2(request: $request) {
    fieldName
  }
}

Types used only by getQueryLogsFacetsV2

QueryLogsFacetRequestTypeV2

Input object type.

FieldTypeDescription
requests[QueryLogsFacetRequestType]

Related types

QueryLogsFacetRequestType, QueryLogsFacetResponseType

getQueryLogTimeline (query)

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

Status: Experimental

Retrieve optimized minimal timeline of queries

Arguments

ArgumentTypeDescription
requestQueryLogsRequestInput!

Returns

QueryLogTimeline

Example

query GetQueryLogTimeline($request: QueryLogsRequestInput!) {
  getQueryLogTimeline(request: $request) {
    total
    results
  }
}

Types used only by getQueryLogTimeline

QueryLogTimeline

Object type.

FieldTypeDescription
totalInt!Total count of timeline items
results[String]!Timeline items (comma-separated fields "timestamp,query_id,query_length,query_group,query_type")

Related types

QueryLogsRequestInput

getQueryPerfMonitorExplanation (query)

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

Arguments

ArgumentTypeDescription
requestGetExplanationRequestType!
configQPMonitorConfigInputType!QP monitor config

Returns

QPMonitorExplanationType

Example

query GetQueryPerfMonitorExplanation($request: GetExplanationRequestType!, $config: QPMonitorConfigInputType!) {
  getQueryPerfMonitorExplanation(request: $request, config: $config) {
    dataPoints {
      queryId
      timestamp
      executionTime
      baselineMetric
      pctIncreaseOverBaselineUpperThreshold
      isBreach
    }
  }
}

Types used only by getQueryPerfMonitorExplanation

GetExplanationRequestType

Input object type.

FieldTypeDescription
queryGroupString!Query group hash
startTimeDateTimeStart time range. By default, current time - 4 weeks
endTimeDateTimeEnd time range. By default, current time

Related types

DateTime, QPMonitorConfigInputType, QPMonitorExplanationType

getQueryPerfMonitorExplanationForEvent (query)

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

Arguments

ArgumentTypeDescription
requestGetExplanationForEventRequestType!

Returns

QPMonitorExplanationType

Example

query GetQueryPerfMonitorExplanationForEvent($request: GetExplanationForEventRequestType!) {
  getQueryPerfMonitorExplanationForEvent(request: $request) {
    dataPoints {
      queryId
      timestamp
      executionTime
      baselineMetric
      pctIncreaseOverBaselineUpperThreshold
      isBreach
    }
  }
}

Types used only by getQueryPerfMonitorExplanationForEvent

GetExplanationForEventRequestType

Input object type.

FieldTypeDescription
eventUuidUUID!Event UUID
startTimeDateTimeStart time range. By default, current time - 4 weeks
endTimeDateTimeEnd time range. By default, current time

Related types

DateTime, QPMonitorExplanationType, UUID

getQueryPerformanceData (query)

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

Get aggregated query performance data

Arguments

ArgumentTypeDescription
requestQueryPerformanceDataRequestType!

Returns

[AggregatedMetricDataType]

Example

query GetQueryPerformanceData($request: QueryPerformanceDataRequestType!) {
  getQueryPerformanceData(request: $request) {
    queryGroup
    timestamp
    value
  }
}

Types used only by getQueryPerformanceData

AggregatedMetricDataType

Object type.

FieldTypeDescription
queryGroupStringQuery group identifier
metricAggregationMetricAggregationOutputTypeMetric aggregation
timestampDateTimeAggregated data timestamp
valueFloatAggregated data value
MetricAggregationInputType

Input object type.

FieldTypeDescription
metricString!Query performance metric
aggregationString!Metric aggregation function
MetricAggregationOutputType

Object type.

FieldTypeDescription
metricStringQuery performance metric
aggregationStringMetric aggregation function
QueryPerformanceDataRequestType

Input object type.

FieldTypeDescription
searchCriteriaSearchCriteriaTypeQuery search criteria
queryGroupValues[String]!Query group identifiers
timeBucketSizeStringSize of time buckets Default: "1h".
metrics[MetricAggregationInputType]!Metric aggregations

Related types

DateTime, SearchCriteriaType

getQueryPerfRuleExecutionHistoryLogs (query)

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

Execution history for a query performance monitor rule. The runEvaluatedRowCount and runBreachedRowCount fields are always null. Row counts are recorded only for validation monitors and row-count custom SQL monitors, not for query performance monitors.

Arguments

ArgumentTypeDescription
ruleUuidUUID!UUID of the Query Performance Monitor/Rule
historyDaysIntNumber of lookback days Default: 7.

Returns

[JobExecutionHistoryLog]

Example

query GetQueryPerfRuleExecutionHistoryLogs($ruleUuid: UUID!) {
  getQueryPerfRuleExecutionHistoryLogs(ruleUuid: $ruleUuid) {
    jobExecutionUuid
    startTime
    status
    endTime
    exceptions
    comparisonDataSourceType
    tableMonitorWarning
    sizeCollectionTableMcon
    sizeCollectionEnabled
    totalInvocationsCount
    totalResultCount
    totalExecutionDuration
    consolidatingJobUuid
    evaluatedRecordCount
    evalScope
    runEvaluatedRowCount
    runBreachedRowCount
  }
}

Related types

JobExecutionHistoryLog, UUID

getQueryRuntimePercentileTimeseries (query)

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

Returns data for the Latency Distribution Line Graph for read queries

Arguments

ArgumentTypeDescription
requestQueryRuntimePercentileTimeSeriesRequestType!

Returns

QueryRuntimePercentileTimeSeriesResponseType

Example

query GetQueryRuntimePercentileTimeseries($request: QueryRuntimePercentileTimeSeriesRequestType!) {
  getQueryRuntimePercentileTimeseries(request: $request) {
    timeBucketSize
  }
}

Types used only by getQueryRuntimePercentileTimeseries

QueryRuntimePercentileTimeSeriesRequestType

Input object type.

FieldTypeDescription
searchCriteriaSearchCriteriaType
timeBucketSizeStringDefault: "1h".
percentiles[Int]!Each time series returned will be for a given percentile. Examples are: 50, 75, 95. 99, 100
includedQueryTypes[QueryLogType]The query log types we want to include in the time series aggregation. The options are [READ], [WRITE] or [READ, WRITE]
QueryRuntimePercentileTimeSeriesResponseType

Object type.

FieldTypeDescription
timeSeriesList[TimeSeries]!
timeBucketSizeString!
TimeSeries

Object type.

FieldTypeDescription
groupValueString!
data[DataPoint]!

Related types

DataPoint, QueryLogType, SearchCriteriaType

getTopQueryGroups (query)

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

Arguments

ArgumentTypeDescription
requestTopQueryGroupsRequestType!

Returns

TopQueryGroupsResponseType

Example

query GetTopQueryGroups($request: TopQueryGroupsRequestType!) {
  getTopQueryGroups(request: $request) {
    total
  }
}

Types used only by getTopQueryGroups

QueryGroupSummaryType

Object type.

FieldTypeDescription
queryGroupFieldString!
queryGroupValueString!
querySnippetString!
userEmailStringDEPRECATED (use displayableFieldValues)
queryCountInt!
avgRuntimeFloat!
maxRuntimeFloat!
sumRuntimeFloat!
avgMetricFloat
maxMetricFloat
sumMetricFloat
warehouseUuidString!
destinationString
destinationMconString
sources[String!]Source tables read by this query group. Only populated for READ queries.
sourcesMcons[String]MCONs for the source tables, positionally aligned with sources. Null entries indicate unresolved MCONs. Only populated for READ queries.
displayableFieldValues[DisplayableFieldValueType]
TopQueryGroupsRequestType

Input object type.

FieldTypeDescription
searchCriteriaSearchCriteriaType!
firstIntDefault: 10.
offsetIntDefault: 0.
sortFieldStringDefault: "sum_runtime".
metricFieldNameString
includedQueryTypes[QueryLogType]Query log types to include. Options are [READ], [WRITE], or [READ, WRITE]. Defaults to [WRITE].
TopQueryGroupsResponseType

Object type.

FieldTypeDescription
totalInt!
topQueryGroups[QueryGroupSummaryType]!

Related types

DisplayableFieldValueType, QueryLogType, SearchCriteriaType

getWarehousePriceRates (query)

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

Status: Experimental

Price rates, compute prices and storage prices for the given warehouses. Only warehouses with a priced rate or a storage price are returned. A warehouse absent from the result either has no known price or sits outside the account's cost agent warehouse scope.

Arguments

ArgumentTypeDescription
warehouseUuids[UUID!]!UUIDs of the warehouses to look up rates for.
rateTypeRateTypeOptional filter: return only this usage type. COMPUTE also empties storagePrices. Omit to return every priced type.
includeBilledPricesBooleanWhen true, a Snowflake warehouse's computePrices and storagePrices are the customer's billed average price where one from the last 35 days exists and the caller has unrestricted performance access. Otherwise every price is standard. priceRates is always standard. Default: false.

Returns

[WarehousePriceRatesOutput!]!

Example

query GetWarehousePriceRates($warehouseUuids: [UUID!]!) {
  getWarehousePriceRates(warehouseUuids: $warehouseUuids) {
    warehouseUuid
  }
}

Types used only by getWarehousePriceRates

ComputeBillingModel

Enum type. How a platform bills compute usage. Set only for platforms with more than
one compute billing model.

ValueDescription
ON_DEMANDBilled by data scanned (per TiB).
SLOT_COMPUTEBilled by slot-time under a reservation (per slot-hour).
ComputePriceOutput

Object type. The price of one unit of compute, with where the price comes from.

FieldTypeDescription
amountFloat!Price of one unit, in currency.
currencyString!Currency code, e.g. "USD".
unitPriceRateUnit!The billing unit one amount prices.
billingModelComputeBillingModelHow this compute usage is billed. Set only on platforms with more than one billing model; null otherwise.
priceSourcePriceSource!Where this price comes from.
asOfDateThe billing day of a BILLED_AVERAGE price. Null on a standard price.
descriptionString!Human/agent-friendly explanation of this price.
PriceRateUnit

Enum type. The billing unit a price rate is denominated in.

ValueDescription
TBOne decimal terabyte (10^12 bytes).
TIBOne binary tebibyte (2^40 bytes) — BigQuery's on-demand billing unit.
SLOT_HOUROne hour of one BigQuery slot (capacity billing).
CREDITOne Snowflake compute credit.
PriceSource

Enum type. Where a price comes from.

ValueDescription
STANDARDThe platform's published standard price.
BILLED_AVERAGEWhat the customer was billed per unit on one day (asOf), from their own billing data.
RateType

Enum type.

ValueDescription
COMPUTEPrice of compute usage; the billing unit varies by platform.
STORAGEPrice of storage usage (one terabyte of storage per month).
StorageBillingModel

Enum type. Which bytes a storage price applies to.

ValueDescription
LOGICALPriced on logical (uncompressed) bytes.
StoragePriceOutput

Object type. The price of storing one unit of data for one month, in the unit the platform's bill uses.

FieldTypeDescription
amountFloat!Price of one unit per month, in currency.
currencyString!Currency code, e.g. "USD".
bytesPerUnitBigInt!Size of one unit in bytes: 1024^4 for a Snowflake TB, 1024^3 for a BigQuery GiB. Divide a byte count by this, then multiply by amount.
unitLabelString!The word the platform's bill uses for one unit, e.g. "TB" or "GiB".
tierStoragePriceTierWhich storage price this is, on a platform that bills storage at more than one rate (BigQuery). Null on a platform with one storage price.
minDaysUnmodifiedIntConsecutive days a table or partition must go unmodified for this price to apply. Set only on BigQuery's long-term price; null otherwise.
billingModelStorageBillingModelWhich bytes this price applies to, on a platform with more than one storage billing model (BigQuery). Null otherwise.
priceSourcePriceSource!Where this price comes from.
asOfDateThe billing day of a BILLED_AVERAGE price. Null on a standard price.
descriptionString!Human/agent-friendly explanation of when this price applies.
StoragePriceTier

Enum type. Which of a platform's storage prices applies to a table or partition.

ValueDescription
ACTIVEApplies to a table or partition modified within the long-term price's minDaysUnmodified days.
LONG_TERMApplies to a table or partition unmodified for at least minDaysUnmodified consecutive days.
WarehousePriceRateOutput

Object type. A warehouse price rate: what one unit of usage costs.

FieldTypeDescription
rateTypeRateType!Which usage this rate prices.
amountFloat!Price of one unit of usage, in currency.
unitPriceRateUnit!The billing unit one amount prices.
billingModelComputeBillingModelHow this compute usage is billed. Set only for compute rates on platforms with more than one billing model; null otherwise.
currencyString!Currency code of the rate, e.g. "USD" or "EUR".
descriptionString!Human/agent-friendly explanation of what the rate measures, e.g. the price of one TB of storage per month.
WarehousePriceRatesOutput

Object type. A warehouse's price rates, compute prices and storage prices.

FieldTypeDescription
warehouseUuidUUID!UUID of the warehouse these rates apply to.
priceRates[WarehousePriceRateOutput!]!Standard usage rates for this warehouse. Can be empty when the warehouse has only storage prices. The STORAGE rate is a flat approximation: storagePrices has the exact storage prices. computePrices and storagePrices can carry billed prices; see includeBilledPrices.
storagePrices[StoragePriceOutput!]!Storage prices for this warehouse, in the unit the platform's bill uses. BigQuery has two, active and long-term. Empty for a platform with no storage price, or when rateType is COMPUTE.
computePrices[ComputePriceOutput!]!Compute prices for this warehouse, each with where it comes from. Empty for a platform with no compute price, or when rateType is STORAGE.

Related types

BigInt, Date, UUID

simulateQueryPerfMonitorEvaluation (query)

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

Arguments

ArgumentTypeDescription
requestSimulateMonitorEvaluationRequestType!
configQPMonitorConfigInputType!Monitor configuration

Returns

QPMonitorSimulationType

Example

query SimulateQueryPerfMonitorEvaluation($request: SimulateMonitorEvaluationRequestType!, $config: QPMonitorConfigInputType!) {
  simulateQueryPerfMonitorEvaluation(request: $request, config: $config) {
    breachingQueryGroups
  }
}

Types used only by simulateQueryPerfMonitorEvaluation

QPMonitorSimulationType

Object type.

FieldTypeDescription
breachingQueryGroups[String]!List of breaching query groups
breachingQueryGroupsDailyCount[DataPoint]Daily count of breaching query groups over evaluation period
SimulateMonitorEvaluationRequestType

Input object type.

FieldTypeDescription
evaluationStartTimeDateTimeEvaluation start time
evaluationEndTimeDateTimeEvaluation end time
limitIntNumber of breaching query groups to return Default: 10.

Related types

DataPoint, DateTime, QPMonitorConfigInputType

warehouseCostTimeSeries (query)

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

Status: Experimental

Storage and query cost over time for the account. Buckets are calendar-aligned (weeks start Monday, months on the 1st) and default to daily unless bucketSize is given. startTime can be at most one year before now. Amounts are estimates in the billing currency.

Arguments

ArgumentTypeDescription
startTimeDateTime!Start of the range (inclusive).
endTimeDateTime!End of the range (inclusive).
warehouseUuids[UUID!]Scope the series to these warehouses. Omit or pass an empty list for the account-wide total across every warehouse.
bucketSizeCostBucketSizeGroup the series by this calendar period. Omit to bucket by day.

Returns

WarehouseCostTimeSeriesOutput!

Example

query WarehouseCostTimeSeries($startTime: DateTime!, $endTime: DateTime!) {
  warehouseCostTimeSeries(startTime: $startTime, endTime: $endTime) {
    bucketSize
  }
}

Types used only by warehouseCostTimeSeries

CostBucketSize

Enum type. Calendar period the cost series is grouped into.

ValueDescription
DAY
WEEK
MONTH
CostTimeSeriesPointOutput

Object type. Storage and query cost totals for one bucket of the series.

FieldTypeDescription
dateDate!Start of the bucket (day, week, or month).
storageCostFloat!Total storage cost in the bucket, in currency.
queryCostFloat!Total query (compute) cost in the bucket, in currency. Covers every compute-family cost type.
currencyString!Currency code of this bucket's amounts, e.g. "USD".
UnsupportedWarehouseOutput

Object type. A warehouse that can't contribute to the series, and why.

FieldTypeDescription
warehouseUuidUUID!UUID of the warehouse.
reasonWarehouseCostUnsupportedReason!Why the warehouse can't contribute cost data.
detailString!Human-readable explanation of the specific cause, including the required collector build when a version is the blocker.
WarehouseCostTimeSeriesOutput

Object type. Account-level storage and query cost over time, summed across the in-scope warehouses into a single combined series.

FieldTypeDescription
points[CostTimeSeriesPointOutput!]!Cost buckets over the requested range, ordered by bucket start.
bucketSizeCostBucketSize!The calendar period the points are grouped into.
unsupportedWarehouses[UnsupportedWarehouseOutput!]!In-scope warehouses that can't contribute cost data, each with a reason. A warehouse that is contributing (or whose window is simply empty) is not listed.
WarehouseCostUnsupportedReason

Enum type. Why a warehouse can't contribute to the cost series.

ValueDescription
NOT_SUPPORTED
NOT_ENABLED
NOT_SCHEDULED
PAUSED
GATHERING_DATA

Related types

Date, DateTime, UUID

Mutations

togglePerformanceDashboardForDomainRestrictedUsers (mutation)

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

Sets the toggle for enabling performance dashboard for domain restricted users

Arguments

ArgumentTypeDescription
enabledBoolean!Enable performance dashboard for domain restricted user

Returns

TogglePerformanceDashboardForDomainRestrictedUsers

Example

mutation TogglePerformanceDashboardForDomainRestrictedUsers($enabled: Boolean!) {
  togglePerformanceDashboardForDomainRestrictedUsers(enabled: $enabled) {
    success
  }
}

Types used only by togglePerformanceDashboardForDomainRestrictedUsers

TogglePerformanceDashboardForDomainRestrictedUsers

Object type. Sets the toggle for enabling performance dashboard for domain restricted users

FieldTypeDescription
successBoolean

Source: The GraphQL API reference

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