Related queries and mutations in Performance and cost. Each has its own section.
Queries
getNewMonitorSpendGuardrail (query)
getNewMonitorSpendGuardrail 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 reached spend guardrail that would save a new monitor created in the UI as a draft. Null when it would save live.
Arguments
| Argument | Type | Description |
|---|---|---|
domainUuid | UUID | The domain the new monitor would be in. Leave it out to check only the account guardrail. |
Returns
NewMonitorSpendGuardrail
Example
query GetNewMonitorSpendGuardrail {
getNewMonitorSpendGuardrail {
scope
domainUuid
resetTime
onlyBilledMonitors
}
}Types used only by getNewMonitorSpendGuardrail
getNewMonitorSpendGuardrailNewMonitorSpendGuardrail
NewMonitorSpendGuardrailObject type. A reached spend guardrail that would save a new monitor as a draft, and when its period starts over.
| Field | Type | Description |
|---|---|---|
scope | SpendGuardrailScope! | |
domainUuid | UUID | The domain at its guardrail. Null for the account. |
resetTime | DateTime! | When the period ends and new monitors save live again. |
onlyBilledMonitors | Boolean! | True on V1 (dollar) pricing, where only a new monitor that adds to the bill is held: a table monitor on a table no running monitor covers, or an agent monitor the contract prices. Every other monitor saves live. |
Related types
DateTime, SpendGuardrailScope, UUID
getSpendGuardrailRecommendations (query)
getSpendGuardrailRecommendations 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
Recommended spend guardrails for the account and its domains.
Returns
SpendGuardrailRecommendations!
Example
query GetSpendGuardrailRecommendations {
getSpendGuardrailRecommendations {
unit
}
}Types used only by getSpendGuardrailRecommendations
getSpendGuardrailRecommendationsAccountRecommendation
AccountRecommendationObject type.
| Field | Type | Description |
|---|---|---|
amount | Int | The recommended monthly guardrail in unit. Null when there isn't enough history or commit data to recommend one. |
rule | AccountRecommendationRule | Null when amount is null. |
AccountRecommendationRule
AccountRecommendationRuleEnum type. What the account recommendation follows.
| Value | Description |
|---|---|
COMMIT | |
AVERAGE |
DomainRecommendation
DomainRecommendationObject type.
| Field | Type | Description |
|---|---|---|
domainUuid | UUID! | |
amount | Int | The recommended daily guardrail in unit. The floor when the domain was first charged less than 30 days ago, or had no spend in the last 30 days. Null when the domain has an active Bayes teammate, because it can't have a guardrail. |
SpendGuardrailRecommendations
SpendGuardrailRecommendationsObject type.
| Field | Type | Description |
|---|---|---|
unit | SpendUnit! | |
account | AccountRecommendation | Null unless the caller has account-wide billing access. |
domains | [DomainRecommendation!]! | The domains the caller may see. |
Related types
getSpendHistory (query)
getSpendHistory 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
Spend per day or per month, split into Monitoring, Bayes and sources.
Arguments
| Argument | Type | Description |
|---|---|---|
period | SpendPeriod! | |
domainUuid | UUID | The domain to read. Leave it out for the whole account, which needs billing access for every domain. |
Returns
SpendHistory!
Example
query GetSpendHistory($period: SpendPeriod!) {
getSpendHistory(period: $period) {
unit
period
}
}Types used only by getSpendHistory
getSpendHistorySpendHistory
SpendHistoryObject type.
| Field | Type | Description |
|---|---|---|
unit | SpendUnit! | |
period | SpendPeriod! | |
points | [SpendHistoryPoint!]! | One point per period, oldest first. Quiet periods are zero. Today, and so the current month, include today's estimate, as getSpendSummary does. |
SpendHistoryPoint
SpendHistoryPointObject type.
| Field | Type | Description |
|---|---|---|
start | Date! | The first day (UTC) of the point's period. |
spend | SpendByKind! | |
bySource | [SpendBySource!]! | The spend per source. Sources with no spend are left out. Deprecated: Use spend.bySource.. |
SpendPeriod
SpendPeriodEnum type. How spend history is bucketed.
| Value | Description |
|---|---|
DAY | One point per day (UTC) over the last 30 days, today included. |
MONTH | One point per calendar month (UTC) over the last 6 months, this month included. |
Related types
Date, SpendByKind, SpendBySource, SpendUnit, UUID
getSpendSummary (query)
getSpendSummary 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
Spend and spend guardrails for the account and its domains: today, month to date and the last 30 days.
Arguments
| Argument | Type | Description |
|---|---|---|
domainUuid | UUID | Return only this domain. |
Returns
SpendSummary!
Example
query GetSpendSummary {
getSpendSummary {
day
unit
guardrailsAvailable
}
}Types used only by getSpendSummary
getSpendSummaryAccountSpend
AccountSpendObject type.
| Field | Type | Description |
|---|---|---|
spend | SpendTotals! | |
guardrail | SpendGuardrail | The monthly account guardrail, if set. |
pace | SpendPace! |
DomainSpend
DomainSpendObject type.
| Field | Type | Description |
|---|---|---|
domainUuid | UUID | The domain. Null for Unassigned: spend that landed in no domain. |
spend | SpendTotals! | |
guardrail | SpendGuardrail | The domain's daily guardrail, if set. Null for Unassigned. |
SpendPace
SpendPaceObject type. The account's month at the average of its last 7 full days. The amounts are null while
unavailableReason is set.
| Field | Type | Description |
|---|---|---|
projectedMonthEnd | Float | The account's spend at the end of this calendar month (UTC) if it keeps this pace. |
reachesGuardrailOn | Date | The day (UTC) this pace reaches the account guardrail. Null without a guardrail, once month to date has reached it, or when this pace stays under it this month. |
unavailableReason | SpendPaceUnavailableReason | Why there is no pace yet. Null when there is. |
availableOn | Date | The first day (UTC) the pace will be available. Set only for NOT_ENOUGH_HISTORY. |
SpendPaceUnavailableReason
SpendPaceUnavailableReasonEnum type. Why the account has no pace yet.
| Value | Description |
|---|---|
NO_SPEND_YET | No full day of spend in the account's current unit yet. |
NOT_ENOUGH_HISTORY | Fewer than 7 full days of spend in the account's current unit. |
SpendSummary
SpendSummaryObject type.
| Field | Type | Description |
|---|---|---|
day | Date! | The UTC day the summary is for. |
unit | SpendUnit! | |
guardrailsAvailable | Boolean! | Whether the account's billing plan has spend guardrails. False on a subscription plan, which isn't charged for agents: guardrails can't be set, and nothing is recorded as spend. |
account | AccountSpend | The whole account's spend and guardrail. Null unless the caller has billing access for every domain and asked for no single domain. |
domains | [DomainSpend!]! | The domains the caller may see. Unassigned comes last, and only with account. |
SpendTotals
SpendTotalsObject type.
| Field | Type | Description |
|---|---|---|
today | SpendByKind! | Spend today (UTC). Sources charged by the day count at their current daily rate, and the others at what was spent so far today. |
monthToDate | SpendByKind! | Spend this calendar month (UTC), today included. |
last30Days | SpendByKind! | Spend over the last 30 days, today included. |
Related types
Date, SpendByKind, SpendGuardrail, SpendUnit, UUID
Mutations
clearSpendGuardrail (mutation)
clearSpendGuardrail 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.
Status: Experimental
Clear the account's or a domain's spend guardrail.
Arguments
| Argument | Type | Description |
|---|---|---|
domainUuid | UUID | The domain. Required for a domain guardrail. |
scope | SpendGuardrailScope! |
Returns
ClearSpendGuardrail
Example
mutation ClearSpendGuardrail($scope: SpendGuardrailScope!) {
clearSpendGuardrail(scope: $scope) {
cleared
}
}Types used only by clearSpendGuardrail
clearSpendGuardrailClearSpendGuardrail
ClearSpendGuardrailObject type. Clear a spend guardrail.
| Field | Type | Description |
|---|---|---|
cleared | Boolean! | Whether there was a guardrail to clear. |
Related types
requestSpendGuardrailRaise (mutation)
requestSpendGuardrailRaise 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.
Status: Experimental
Ask the Account Owners to raise a spend guardrail.
Arguments
| Argument | Type | Description |
|---|---|---|
domainUuid | UUID | The domain. Required for a domain guardrail. The caller must see the domain's alerts or monitors. |
metadata | SpendGuardrailRaiseRequestMetadata | Where the request came from, for analytics. Not stored. |
origin | String! | Where the request comes from, as free text, such as app or chat. At most 64 characters. |
scope | SpendGuardrailScope! |
Returns
RequestSpendGuardrailRaise
Example
mutation RequestSpendGuardrailRaise($origin: String!, $scope: SpendGuardrailScope!) {
requestSpendGuardrailRaise(origin: $origin, scope: $scope) {
success
}
}Types used only by requestSpendGuardrailRaise
requestSpendGuardrailRaiseRequestSpendGuardrailRaise
RequestSpendGuardrailRaiseObject type. Ask the Account Owners to raise a spend guardrail.
| Field | Type | Description |
|---|---|---|
success | Boolean! |
SpendGuardrailRaiseRequestMetadata
SpendGuardrailRaiseRequestMetadataInput object type. Where a request to raise a guardrail came from. Every field is optional.
| Field | Type | Description |
|---|---|---|
pageUrl | String | The page the request came from, at most 2048 characters. Its query string and fragment are dropped. |
alertUuid | UUID | The alert the person was blocked on. |
blockedAction | String | What was blocked, such as troubleshoot, at most 64 characters. |
Related types
setSpendGuardrail (mutation)
setSpendGuardrail 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.
Status: Experimental
Set or change the account's and domains' spend guardrails, all or none.
Arguments
| Argument | Type | Description |
|---|---|---|
confirmBelowCurrentSpend | Boolean | Set the guardrails even when some are below current spend: month to date for the account, today for a domain. Without it, such a request sets nothing and is refused with the SPEND_GUARDRAIL_BELOW_CURRENT_SPEND error. Its extensions carry unit and guardrails: the scope, domainUuid and currentSpend of each guardrail below current spend. Default: false. |
guardrails | [SpendGuardrailInput!]! | The guardrails to set, at most one each. |
Returns
SetSpendGuardrail
Example
mutation SetSpendGuardrail($guardrails: [SpendGuardrailInput!]!) {
setSpendGuardrail(guardrails: $guardrails) {
guardrails {
uuid
scope
domainUuid
amount
unit
origin
setBy
setTime
}
}
}Types used only by setSpendGuardrail
setSpendGuardrailSetSpendGuardrail
SetSpendGuardrailObject type. Set or change spend guardrails: the account's, any number of domains', or both. Either
all of them are set or none are.
| Field | Type | Description |
|---|---|---|
guardrails | [SpendGuardrail!]! | The guardrails set. |
SpendGuardrailInput
SpendGuardrailInputInput object type.
| Field | Type | Description |
|---|---|---|
scope | SpendGuardrailScope! | |
domainUuid | UUID | The domain. Required for a domain guardrail. |
amount | Int! | The limit in the account's unit, at least 1. |
Related types
SpendGuardrail, SpendGuardrailScope, UUID
Source: The GraphQL API reference
This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.
