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
| Argument | Type | Description |
|---|---|---|
domainId | UUID | Keep the table and job findings in this domain. Without it, a domain-restricted caller gets those in its accessible domains. |
since | DateTime | When 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. |
stableKey | String | Read 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
getAgentCostFindingsAgentCostFindingSection
AgentCostFindingSectionEnum type. Where a digest item belongs: a domain's own findings, or the account's.
| Value | Description |
|---|---|
DOMAIN | |
ACCOUNT |
AgentCostFindingsAvailability
AgentCostFindingsAvailabilityEnum type. Whether the account's cost findings can be read, and why not.
| Value | Description |
|---|---|
AVAILABLE | |
PIPELINE_OFF | |
NO_RUN_YET | |
NOT_ON_V2 | |
FETCH_FAILED |
AgentCostFindingsOutput
AgentCostFindingsOutputObject type. The account's latest cost findings, shaped for an agent's digest.
| Field | Type | Description |
|---|---|---|
availability | AgentCostFindingsAvailability! | 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. |
reason | String | Why 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. |
totals | AgentCostTotalsOutput! | Totals over the items returned. Items the caps, the repeat rule or the free tier left out are not counted. |
domainTotals | AgentCostTotalsOutput! | Totals over the DOMAIN items returned. |
accountTotals | AgentCostTotalsOutput! | Totals over the ACCOUNT (warehouse setting) items returned. |
warehouses | [CostFindingWarehouseOutput!]! | The warehouses the items returned name, each once. |
domainMoreCount | Int! | 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. |
accountMoreCount | Int! | 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. |
hiddenCount | Int! | How many items the account's free tier does not show. Items the repeat rule held back are not counted. |
upgradeRequired | Boolean! | Whether items are hidden until the account upgrades. |
upgradeReason | String | What to tell the account when items are hidden. |
upgradeUrl | String | The 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. |
hasNewRun | Boolean! | False when no run ended after 'since': every finding is still open. |
runThreadId | String | The run the findings were read from. |
runStartedAt | DateTime | When the run the findings came from started. |
runEndedAt | DateTime | When that run ended. Null when it recorded no end time. |
latestRunFailed | Boolean! | The newest run failed, so these are the newest earlier run's findings. |
AgentCostItemOutput
AgentCostItemOutputObject type. One digest line: the findings of one overlap group, which act on the same table, warehouse or job.
| Field | Type | Description |
|---|---|---|
section | AgentCostFindingSection! | DOMAIN for table and job findings, ACCOUNT for warehouse settings. |
overlapGroup | String! | 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. |
isNew | Boolean! | Whether any of its findings is new since the last digest. |
stillOpenSince | DateTime | For 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. |
stillOpenSinceBefore | Boolean! | True when the item was open before 'stillOpenSince': the oldest run read still had it, or an earlier run couldn't be read. |
savingUsd | Float | The 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
AgentCostTotalsOutputObject type. Totals computed in code over the items returned.
| Field | Type | Description |
|---|---|---|
savingUsd | Float | The 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. |
warehousesUsdPerMonth | Float | The measured monthly spend of the warehouses the items name, each counted once. Null when none is known. |
CostFindingWarehouseOutput
CostFindingWarehouseOutputObject type. A platform warehouse the findings name, and what the whole warehouse costs a month.
| Field | Type | Description |
|---|---|---|
platform | String! | The platform, lowercase. |
platformAccount | String | The Snowflake account, when known. |
warehouseId | String! | The platform's warehouse ID. |
name | String | The warehouse's name on the platform, when known. |
reportedBy | [UUID!]! | UUIDs of the Monte Carlo warehouses that report it. |
usdPerMonth | Float | The whole warehouse's measured compute spend a month, all its work. Null when unknown; 'withheld' then says why. |
withheld | CostFindingWithheldFigureOutput | Why '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
getCostKeyFindingsCostKeyFindings
CostKeyFindingsObject type. The cost findings the Key findings tab shows, and the analyses the run couldn't do.
| Field | Type | Description |
|---|---|---|
asOfTime | DateTime | The 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
| Argument | Type | Description |
|---|---|---|
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
getIndexedFieldSpecsDashboardType
DashboardTypeEnum type.
| Value | Description |
|---|---|
READ | |
WRITE |
IndexedFieldSpecType
IndexedFieldSpecTypeObject type.
| Field | Type | Description |
|---|---|---|
fieldName | String | |
displayName | String | |
displayable | Boolean | |
aggregatable | Boolean | |
facetable | Boolean | |
filterable | Boolean | |
facetSearchable | Boolean | |
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
| Argument | Type | Description |
|---|---|---|
mcInternalView | Boolean | Temporary, 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
getPerformancePageInsightsAssumedCreditRateOutput
AssumedCreditRateOutputObject type. The per-credit rate a Snowflake compute figure's dollars were priced at.
| Field | Type | Description |
|---|---|---|
amount | Float! | Dollars per credit. |
currency | String! | ISO currency code of the amount, e.g. 'USD'. |
unit | String! | Unit of 'amount', always 'USD/credit'. |
CostFindingDisappearedOutput
CostFindingDisappearedOutputObject type. A finding the previous cost insights run had and this run does not.
| Field | Type | Description |
|---|---|---|
fixType | CostFindingFixType! | |
warehouseUuids | [UUID!]! | UUIDs of every warehouse that reported what the finding targeted. |
targets | [CostFindingTargetOutput!]! | |
stableKey | String! | The finding's key, in the current run's 'keyVersion'. |
keyVersion | Int! | |
finding | CostFindingOutput | The 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
CostFindingPreviousRunOutputObject type. The run a cost insights run's findings were compared with.
| Field | Type | Description |
|---|---|---|
status | CostFindingPreviousRunStatus! | |
threadId | String | Identifier of the run compared with. Set when 'status' is 'COMPARED'. |
CostFindingPreviousRunStatus
CostFindingPreviousRunStatusEnum type. Whether a run's findings were compared with the previous run.
| Value | Description |
|---|---|
COMPARED | Compared with the previous run. |
NO_PREVIOUS_RUN | No previous run to compare with. |
UNAVAILABLE | The previous run couldn't be read, or every recent run failed. |
CostInsightsShadowRunOutput
CostInsightsShadowRunOutputObject type. Temporary, for Monte Carlo internal use only.
| Field | Type | Description |
|---|---|---|
status | CostInsightsShadowRunStatus! | |
failureReason | String | Why the new pipeline stored no findings. Set only when status is FAILED. |
failedStep | String | The step the new pipeline failed at. Set only when status is FAILED. |
contractVersion | Int | |
insights | [PerformancePageInsightOutput!]! | |
insightsCount | Int! | 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!]! | |
previousRun | CostFindingPreviousRunOutput | |
disappearedFindings | [CostFindingDisappearedOutput!]! |
CostInsightsShadowRunStatus
CostInsightsShadowRunStatusEnum type. Whether the shown run kept a new-pipeline result, and if so whether it is readable.
| Value | Description |
|---|---|
COMPLETED | The run stored the new pipeline's findings. |
FAILED | The new pipeline ran and stored no findings. |
NO_SHADOW_RUN | The run shown didn't run the new pipeline. |
UNAVAILABLE | The run couldn't be read. |
EstimatedCostOutput
EstimatedCostOutputObject 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.
| Field | Type | Description |
|---|---|---|
amount | Float! | Estimated current spend, per 'period'. |
currency | String! | ISO currency code of the amount, e.g. 'USD'. |
period | String! | Period the cost is expressed over, e.g. 'month'. |
EstimatedCreditsOutput
EstimatedCreditsOutputObject 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.
| Field | Type | Description |
|---|---|---|
amount | Float! | Credits, per 'period'. |
unit | String! | Unit of 'amount', always 'credits'. |
period | String! | Period the figure is expressed over, e.g. 'month'. |
EstimatedSavingsOutput
EstimatedSavingsOutputObject type. An estimated monetary saving for an insight.
| Field | Type | Description |
|---|---|---|
amount | Float! | Estimated saving amount, per 'period'. |
currency | String! | ISO currency code of the amount, e.g. 'USD'. |
period | String! | Period the saving is expressed over, e.g. 'month'. |
InsightImpactOutput
InsightImpactOutputObject type. An insight's headline impact in its native, non-dollar unit.
| Field | Type | Description |
|---|---|---|
kind | PerformanceInsightImpactKind! | Whether the impact is reclaimable storage or recurring compute time. |
value | Float! | Impact quantity, in 'unit' over 'period'. |
unit | String! | Unit of 'value': 'mb', 'gb' or 'tb' for storage; 'seconds', 'minutes' or 'hours' for time. Normalize across units before comparing or aggregating. |
period | String! | Period 'value' is expressed over, e.g. 'month'. |
PerformanceInsightCategory
PerformanceInsightCategoryEnum type. Finding type of a cost/performance insight.
| Value | Description |
|---|---|
READ | |
WRITE | |
STORAGE | |
RUNTIME |
PerformanceInsightImpactKind
PerformanceInsightImpactKindEnum type. Dimension a cost/performance insight's headline impact is measured in.
| Value | Description |
|---|---|
STORAGE | |
TIME |
PerformancePageInsightOutput
PerformancePageInsightOutputObject type. A single insight surfaced on the Performance Page.
| Field | Type | Description |
|---|---|---|
key | String! | Identifies this insight within the run that produced it, so a ticket can be filed against it. Only meaningful alongside that run's 'threadId'. |
title | String! | Full insight title, as a sentence. |
headline | String | Short, scannable version of the title for card display. Null when the run did not produce one. |
category | PerformanceInsightCategory | Finding type of the insight. Null when the insight has no single applicable category. |
content | String! | Insight body. |
relatedMcons | [String!]! | MCONs of the catalog objects this insight references. |
relatedWarehouses | [UUID!]! | UUIDs of the warehouses this insight references. |
estimatedSavings | EstimatedSavingsOutput | Estimated cost saving if the insight's recommendation is acted on. Null when the insight has no quantifiable saving. |
estimatedCost | EstimatedCostOutput | Estimated 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'. |
estimatedSavingsCredits | EstimatedCreditsOutput | 'estimatedSavings' before it was priced into dollars. Null whenever 'estimatedSavings' is, and for a run predating this field. |
estimatedCostCredits | EstimatedCreditsOutput | 'estimatedCost' before it was priced into dollars. Null whenever 'estimatedCost' is, and for a run predating this field. |
assumedCreditRate | AssumedCreditRateOutput | The rate 'estimatedSavingsCredits' / 'estimatedCostCredits' were priced at. Null unless at least one of them is set. |
impact | InsightImpactOutput | The 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. |
finding | CostFindingOutput | The 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
PerformancePageInsightsOutputObject type. Cost insights surfaced on the Performance Page.
| Field | Type | Description |
|---|---|---|
isEnabled | Boolean! | 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. |
disabledReason | String | When 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. |
spendGuardrailReached | SpendGuardrailReached | The 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. |
insightsCount | Int! | 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'. |
threadId | String | Identifier of the run that produced these insights. Null when insights are unavailable for the caller's account. |
createdTime | DateTime | When the run that produced these insights started. Null when insights are unavailable for the caller's account. |
contractVersion | Int | Which 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. |
previousRun | CostFindingPreviousRunOutput | Whether 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. |
latestRunFailed | Boolean! | 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. |
shadowRun | CostInsightsShadowRunOutput | Temporary, 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
SpendGuardrailReachedObject type. A spend guardrail that is reached, and when its period starts over.
| Field | Type | Description |
|---|---|---|
scope | SpendGuardrailScope! | |
amount | Int! | The guardrail's limit, in unit. |
spent | Float! | What the guardrail's scope spent this period, in unit. |
unit | SpendUnit! | The unit amount and spent are in. |
resetTime | DateTime! | 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
| Argument | Type | Description |
|---|---|---|
request | QueryLogsRequestInput! |
Returns
QueryLogsResponseType
Example
query GetQueryLogs($request: QueryLogsRequestInput!) {
getQueryLogs(request: $request) {
total
}
}Types used only by getQueryLogs
getQueryLogsQueryLogsResponseType
QueryLogsResponseTypeObject type.
| Field | Type | Description |
|---|---|---|
total | Int! | |
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
| Argument | Type | Description |
|---|---|---|
request | QueryLogsFacetRequestType! |
Returns
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
| Argument | Type | Description |
|---|---|---|
request | QueryLogsFacetRequestTypeV2! |
Returns
Example
query GetQueryLogsFacetsV2($request: QueryLogsFacetRequestTypeV2!) {
getQueryLogsFacetsV2(request: $request) {
fieldName
}
}Types used only by getQueryLogsFacetsV2
getQueryLogsFacetsV2QueryLogsFacetRequestTypeV2
QueryLogsFacetRequestTypeV2Input object type.
| Field | Type | Description |
|---|---|---|
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
| Argument | Type | Description |
|---|---|---|
request | QueryLogsRequestInput! |
Returns
QueryLogTimeline
Example
query GetQueryLogTimeline($request: QueryLogsRequestInput!) {
getQueryLogTimeline(request: $request) {
total
results
}
}Types used only by getQueryLogTimeline
getQueryLogTimelineQueryLogTimeline
QueryLogTimelineObject type.
| Field | Type | Description |
|---|---|---|
total | Int! | Total count of timeline items |
results | [String]! | Timeline items (comma-separated fields "timestamp,query_id,query_length,query_group,query_type") |
Related types
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
| Argument | Type | Description |
|---|---|---|
request | GetExplanationRequestType! | |
config | QPMonitorConfigInputType! | QP monitor config |
Returns
Example
query GetQueryPerfMonitorExplanation($request: GetExplanationRequestType!, $config: QPMonitorConfigInputType!) {
getQueryPerfMonitorExplanation(request: $request, config: $config) {
dataPoints {
queryId
timestamp
executionTime
baselineMetric
pctIncreaseOverBaselineUpperThreshold
isBreach
}
}
}Types used only by getQueryPerfMonitorExplanation
getQueryPerfMonitorExplanationGetExplanationRequestType
GetExplanationRequestTypeInput object type.
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
| Argument | Type | Description |
|---|---|---|
request | GetExplanationForEventRequestType! |
Returns
Example
query GetQueryPerfMonitorExplanationForEvent($request: GetExplanationForEventRequestType!) {
getQueryPerfMonitorExplanationForEvent(request: $request) {
dataPoints {
queryId
timestamp
executionTime
baselineMetric
pctIncreaseOverBaselineUpperThreshold
isBreach
}
}
}Types used only by getQueryPerfMonitorExplanationForEvent
getQueryPerfMonitorExplanationForEventGetExplanationForEventRequestType
GetExplanationForEventRequestTypeInput object type.
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
| Argument | Type | Description |
|---|---|---|
request | QueryPerformanceDataRequestType! |
Returns
[AggregatedMetricDataType]
Example
query GetQueryPerformanceData($request: QueryPerformanceDataRequestType!) {
getQueryPerformanceData(request: $request) {
queryGroup
timestamp
value
}
}Types used only by getQueryPerformanceData
getQueryPerformanceDataAggregatedMetricDataType
AggregatedMetricDataTypeObject type.
| Field | Type | Description |
|---|---|---|
queryGroup | String | Query group identifier |
metricAggregation | MetricAggregationOutputType | Metric aggregation |
timestamp | DateTime | Aggregated data timestamp |
value | Float | Aggregated data value |
MetricAggregationInputType
MetricAggregationInputTypeInput object type.
| Field | Type | Description |
|---|---|---|
metric | String! | Query performance metric |
aggregation | String! | Metric aggregation function |
MetricAggregationOutputType
MetricAggregationOutputTypeObject type.
| Field | Type | Description |
|---|---|---|
metric | String | Query performance metric |
aggregation | String | Metric aggregation function |
QueryPerformanceDataRequestType
QueryPerformanceDataRequestTypeInput object type.
| Field | Type | Description |
|---|---|---|
searchCriteria | SearchCriteriaType | Query search criteria |
queryGroupValues | [String]! | Query group identifiers |
timeBucketSize | String | Size of time buckets Default: "1h". |
metrics | [MetricAggregationInputType]! | Metric aggregations |
Related types
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
| Argument | Type | Description |
|---|---|---|
ruleUuid | UUID! | UUID of the Query Performance Monitor/Rule |
historyDays | Int | Number of lookback days Default: 7. |
Returns
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
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
| Argument | Type | Description |
|---|---|---|
request | QueryRuntimePercentileTimeSeriesRequestType! |
Returns
QueryRuntimePercentileTimeSeriesResponseType
Example
query GetQueryRuntimePercentileTimeseries($request: QueryRuntimePercentileTimeSeriesRequestType!) {
getQueryRuntimePercentileTimeseries(request: $request) {
timeBucketSize
}
}Types used only by getQueryRuntimePercentileTimeseries
getQueryRuntimePercentileTimeseriesQueryRuntimePercentileTimeSeriesRequestType
QueryRuntimePercentileTimeSeriesRequestTypeInput object type.
| Field | Type | Description |
|---|---|---|
searchCriteria | SearchCriteriaType | |
timeBucketSize | String | Default: "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
QueryRuntimePercentileTimeSeriesResponseTypeObject type.
| Field | Type | Description |
|---|---|---|
timeSeriesList | [TimeSeries]! | |
timeBucketSize | String! |
TimeSeries
TimeSeriesObject type.
| Field | Type | Description |
|---|---|---|
groupValue | String! | |
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
| Argument | Type | Description |
|---|---|---|
request | TopQueryGroupsRequestType! |
Returns
TopQueryGroupsResponseType
Example
query GetTopQueryGroups($request: TopQueryGroupsRequestType!) {
getTopQueryGroups(request: $request) {
total
}
}Types used only by getTopQueryGroups
getTopQueryGroupsQueryGroupSummaryType
QueryGroupSummaryTypeObject type.
| Field | Type | Description |
|---|---|---|
queryGroupField | String! | |
queryGroupValue | String! | |
querySnippet | String! | |
userEmail | String | DEPRECATED (use displayableFieldValues) |
queryCount | Int! | |
avgRuntime | Float! | |
maxRuntime | Float! | |
sumRuntime | Float! | |
avgMetric | Float | |
maxMetric | Float | |
sumMetric | Float | |
warehouseUuid | String! | |
destination | String | |
destinationMcon | String | |
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
TopQueryGroupsRequestTypeInput object type.
| Field | Type | Description |
|---|---|---|
searchCriteria | SearchCriteriaType! | |
first | Int | Default: 10. |
offset | Int | Default: 0. |
sortField | String | Default: "sum_runtime". |
metricFieldName | String | |
includedQueryTypes | [QueryLogType] | Query log types to include. Options are [READ], [WRITE], or [READ, WRITE]. Defaults to [WRITE]. |
TopQueryGroupsResponseType
TopQueryGroupsResponseTypeObject type.
| Field | Type | Description |
|---|---|---|
total | Int! | |
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
| Argument | Type | Description |
|---|---|---|
warehouseUuids | [UUID!]! | UUIDs of the warehouses to look up rates for. |
rateType | RateType | Optional filter: return only this usage type. COMPUTE also empties storagePrices. Omit to return every priced type. |
includeBilledPrices | Boolean | When 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
getWarehousePriceRatesComputeBillingModel
ComputeBillingModelEnum type. How a platform bills compute usage. Set only for platforms with more than
one compute billing model.
| Value | Description |
|---|---|
ON_DEMAND | Billed by data scanned (per TiB). |
SLOT_COMPUTE | Billed by slot-time under a reservation (per slot-hour). |
ComputePriceOutput
ComputePriceOutputObject type. The price of one unit of compute, with where the price comes from.
| Field | Type | Description |
|---|---|---|
amount | Float! | Price of one unit, in currency. |
currency | String! | Currency code, e.g. "USD". |
unit | PriceRateUnit! | The billing unit one amount prices. |
billingModel | ComputeBillingModel | How this compute usage is billed. Set only on platforms with more than one billing model; null otherwise. |
priceSource | PriceSource! | Where this price comes from. |
asOf | Date | The billing day of a BILLED_AVERAGE price. Null on a standard price. |
description | String! | Human/agent-friendly explanation of this price. |
PriceRateUnit
PriceRateUnitEnum type. The billing unit a price rate is denominated in.
| Value | Description |
|---|---|
TB | One decimal terabyte (10^12 bytes). |
TIB | One binary tebibyte (2^40 bytes) — BigQuery's on-demand billing unit. |
SLOT_HOUR | One hour of one BigQuery slot (capacity billing). |
CREDIT | One Snowflake compute credit. |
PriceSource
PriceSourceEnum type. Where a price comes from.
| Value | Description |
|---|---|
STANDARD | The platform's published standard price. |
BILLED_AVERAGE | What the customer was billed per unit on one day (asOf), from their own billing data. |
RateType
RateTypeEnum type.
| Value | Description |
|---|---|
COMPUTE | Price of compute usage; the billing unit varies by platform. |
STORAGE | Price of storage usage (one terabyte of storage per month). |
StorageBillingModel
StorageBillingModelEnum type. Which bytes a storage price applies to.
| Value | Description |
|---|---|
LOGICAL | Priced on logical (uncompressed) bytes. |
StoragePriceOutput
StoragePriceOutputObject type. The price of storing one unit of data for one month, in the unit the platform's bill uses.
| Field | Type | Description |
|---|---|---|
amount | Float! | Price of one unit per month, in currency. |
currency | String! | Currency code, e.g. "USD". |
bytesPerUnit | BigInt! | 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. |
unitLabel | String! | The word the platform's bill uses for one unit, e.g. "TB" or "GiB". |
tier | StoragePriceTier | Which storage price this is, on a platform that bills storage at more than one rate (BigQuery). Null on a platform with one storage price. |
minDaysUnmodified | Int | Consecutive days a table or partition must go unmodified for this price to apply. Set only on BigQuery's long-term price; null otherwise. |
billingModel | StorageBillingModel | Which bytes this price applies to, on a platform with more than one storage billing model (BigQuery). Null otherwise. |
priceSource | PriceSource! | Where this price comes from. |
asOf | Date | The billing day of a BILLED_AVERAGE price. Null on a standard price. |
description | String! | Human/agent-friendly explanation of when this price applies. |
StoragePriceTier
StoragePriceTierEnum type. Which of a platform's storage prices applies to a table or partition.
| Value | Description |
|---|---|
ACTIVE | Applies to a table or partition modified within the long-term price's minDaysUnmodified days. |
LONG_TERM | Applies to a table or partition unmodified for at least minDaysUnmodified consecutive days. |
WarehousePriceRateOutput
WarehousePriceRateOutputObject type. A warehouse price rate: what one unit of usage costs.
| Field | Type | Description |
|---|---|---|
rateType | RateType! | Which usage this rate prices. |
amount | Float! | Price of one unit of usage, in currency. |
unit | PriceRateUnit! | The billing unit one amount prices. |
billingModel | ComputeBillingModel | How this compute usage is billed. Set only for compute rates on platforms with more than one billing model; null otherwise. |
currency | String! | Currency code of the rate, e.g. "USD" or "EUR". |
description | String! | Human/agent-friendly explanation of what the rate measures, e.g. the price of one TB of storage per month. |
WarehousePriceRatesOutput
WarehousePriceRatesOutputObject type. A warehouse's price rates, compute prices and storage prices.
| Field | Type | Description |
|---|---|---|
warehouseUuid | UUID! | 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
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
| Argument | Type | Description |
|---|---|---|
request | SimulateMonitorEvaluationRequestType! | |
config | QPMonitorConfigInputType! | Monitor configuration |
Returns
QPMonitorSimulationType
Example
query SimulateQueryPerfMonitorEvaluation($request: SimulateMonitorEvaluationRequestType!, $config: QPMonitorConfigInputType!) {
simulateQueryPerfMonitorEvaluation(request: $request, config: $config) {
breachingQueryGroups
}
}Types used only by simulateQueryPerfMonitorEvaluation
simulateQueryPerfMonitorEvaluationQPMonitorSimulationType
QPMonitorSimulationTypeObject type.
| Field | Type | Description |
|---|---|---|
breachingQueryGroups | [String]! | List of breaching query groups |
breachingQueryGroupsDailyCount | [DataPoint] | Daily count of breaching query groups over evaluation period |
SimulateMonitorEvaluationRequestType
SimulateMonitorEvaluationRequestTypeInput object type.
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
| Argument | Type | Description |
|---|---|---|
startTime | DateTime! | Start of the range (inclusive). |
endTime | DateTime! | 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. |
bucketSize | CostBucketSize | Group 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
warehouseCostTimeSeriesCostBucketSize
CostBucketSizeEnum type. Calendar period the cost series is grouped into.
| Value | Description |
|---|---|
DAY | |
WEEK | |
MONTH |
CostTimeSeriesPointOutput
CostTimeSeriesPointOutputObject type. Storage and query cost totals for one bucket of the series.
| Field | Type | Description |
|---|---|---|
date | Date! | Start of the bucket (day, week, or month). |
storageCost | Float! | Total storage cost in the bucket, in currency. |
queryCost | Float! | Total query (compute) cost in the bucket, in currency. Covers every compute-family cost type. |
currency | String! | Currency code of this bucket's amounts, e.g. "USD". |
UnsupportedWarehouseOutput
UnsupportedWarehouseOutputObject type. A warehouse that can't contribute to the series, and why.
| Field | Type | Description |
|---|---|---|
warehouseUuid | UUID! | UUID of the warehouse. |
reason | WarehouseCostUnsupportedReason! | Why the warehouse can't contribute cost data. |
detail | String! | Human-readable explanation of the specific cause, including the required collector build when a version is the blocker. |
WarehouseCostTimeSeriesOutput
WarehouseCostTimeSeriesOutputObject type. Account-level storage and query cost over time, summed across the in-scope warehouses into a single combined series.
| Field | Type | Description |
|---|---|---|
points | [CostTimeSeriesPointOutput!]! | Cost buckets over the requested range, ordered by bucket start. |
bucketSize | CostBucketSize! | 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
WarehouseCostUnsupportedReasonEnum type. Why a warehouse can't contribute to the cost series.
| Value | Description |
|---|---|
NOT_SUPPORTED | |
NOT_ENABLED | |
NOT_SCHEDULED | |
PAUSED | |
GATHERING_DATA |
Related types
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
| Argument | Type | Description |
|---|---|---|
enabled | Boolean! | Enable performance dashboard for domain restricted user |
Returns
TogglePerformanceDashboardForDomainRestrictedUsers
Example
mutation TogglePerformanceDashboardForDomainRestrictedUsers($enabled: Boolean!) {
togglePerformanceDashboardForDomainRestrictedUsers(enabled: $enabled) {
success
}
}Types used only by togglePerformanceDashboardForDomainRestrictedUsers
togglePerformanceDashboardForDomainRestrictedUsersTogglePerformanceDashboardForDomainRestrictedUsers
TogglePerformanceDashboardForDomainRestrictedUsersObject type. Sets the toggle for enabling performance dashboard for domain restricted users
| Field | Type | Description |
|---|---|---|
success | Boolean |
Source: The GraphQL API reference
This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.
