Remediation (GraphQL)

Related queries and mutations in AI features. Each has its own section.

Queries

getRemediationResult (query)

getRemediationResult is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Get the remediation plan derived from an alert's troubleshooting analysis. Read-only: it never starts one — use startRemediation for that. Returns a plan of the alert's served version, or its v1 plan when it has none. Returns NOT_FOUND when no plan is available to read — including when one cannot be retrieved, so treat it as "nothing to show" rather than proof that none exists.

Arguments

ArgumentTypeDescription
alertIdUUID!UUID of the alert to get the remediation result for
tsaRunIdStringThe analysis run whose plan to return. Omit it for the newest plan, of any analysis, of the version served for the alert (see getRemediationServedVersion).

Returns

RemediationResult

Example

query GetRemediationResult($alertId: UUID!) {
  getRemediationResult(alertId: $alertId) {
    status
    tsaRunId
    title
    summary
    instructions
    recommendedActions
    responseTypes
    referenceUuid
    graphVersion
    drafted
    confidence
    cause
    provenance
    tuningMonitorUuid
    tuningRunUuid
    plan
  }
}

Related types

RemediationResult, UUID

getRemediationResults (query)

getRemediationResults is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

For Monte Carlo agents only. Get the newest stored remediation plan of one graph version for each alert, in the order the alerts were sent. Read-only, and only plans the agent already reported: never RUNNING or FAILED.

Arguments

ArgumentTypeDescription
alertIds[UUID!]!UUIDs of the alerts, at most 20 distinct. A repeated UUID is returned once.
graphVersionString!The remediation graph version whose plans to read: v1 or v2. Plans of this version are read whatever version each alert is served.

Returns

[StoredRemediationResult!]!

Example

query GetRemediationResults($alertIds: [UUID!]!, $graphVersion: String!) {
  getRemediationResults(alertIds: $alertIds, graphVersion: $graphVersion) {
    alertId
    status
    classification
    planSummary
    exitReason
    completedTime
  }
}

Types used only by getRemediationResults

StoredRemediationResult

Object type. The newest stored remediation plan of one graph version for one alert.

FieldTypeDescription
alertIdUUID!UUID of the alert.
statusRemediationStatus!COMPLETED when the alert has a stored plan of the requested version that this request may read, else NOT_FOUND.
classificationStringThe plan's primary response type, such as fix_the_code, rerun_pipeline, tune_monitor, hand_off or close_with_explanation. Null unless status is COMPLETED.
planSummaryStringThe plan summary, as plain text. The remediation agent wrote it from customer content, so never render it as HTML. Null unless status is COMPLETED, or when the plan has no summary.
exitReasonStringWhich path of the remediation graph produced the plan, as the agent reported it, such as investigated. A run that ended early, such as investigate_failed, stores a fallback plan. Null unless status is COMPLETED, or when the agent did not report it.
completedTimeDateTimeWhen the agent reported the plan. Null unless status is COMPLETED.

Related types

DateTime, RemediationStatus, UUID

getRemediationServedVersion (query)

getRemediationServedVersion is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

The remediation plan version served for an alert. A dispatcher starts the graph that builds this version. Readers serve the alert's plan of this version, or its v1 plan when it has no v2 plan.

Arguments

ArgumentTypeDescription
alertIdUUID!UUID of the alert

Returns

String!

Example

query GetRemediationServedVersion($alertId: UUID!) {
  getRemediationServedVersion(alertId: $alertId)
}

Related types

UUID

Mutations

openRemediationPullRequest (mutation)

openRemediationPullRequest is a mutation in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Start the draft pull request an alert's remediation plan offers

Arguments

ArgumentTypeDescription
alertIdUUID!The alert the plan is for.
referenceUuidUUID!The plan's referenceUuid, as getRemediationResult shows.

Returns

OpenRemediationPullRequest

Example

mutation OpenRemediationPullRequest($alertId: UUID!, $referenceUuid: UUID!) {
  openRemediationPullRequest(alertId: $alertId, referenceUuid: $referenceUuid) {
    outcome
    message
  }
}

Types used only by openRemediationPullRequest

OpenRemediationPullRequest

Object type. Start the run that opens a draft pull request from the alert's remediation plan, in the repository the plan's pull request offer names, as the calling user. One pull request run per alert issue: a second call, or a call for another alert of the issue, starts nothing and returns the existing one. Not idempotent on GitHub, so never retry it automatically.

FieldTypeDescription
outcomeRemediationPullRequestOutcome!
messageStringFixed text for the person when the call has no pull request to show.
pullRequestRemediationPullRequestThe pull request run of the alert, or else of another alert of its issue: the one this call started, or the one it already had. Null when there is none, or while another call is opening it.
RemediationPullRequestOutcome

Enum type. What one click on Open pull request did. OPENED: this call started the run that opens
the draft pull request. ALREADY_EXISTS: the alert, or another alert of its issue, already
has a pull request run, or one is being opened. NO_PERMISSION: the caller may not open a
pull request for this alert.
NOT_AVAILABLE: Monte Carlo cannot open a pull request in the repository. PLAN_NOT_READY:
the plan changed or has no pull request draft. FAILED: the run could not be started.

ValueDescription
OPENED
ALREADY_EXISTS
NO_PERMISSION
NOT_AVAILABLE
PLAN_NOT_READY
FAILED

Related types

RemediationPullRequest, UUID

openRemediationTicket (mutation)

openRemediationTicket is a mutation in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Open a Linear or Jira ticket from an alert's remediation plan, or comment on its issue's ticket

Arguments

ArgumentTypeDescription
alertIdUUID!The alert the plan is for.
overridesOpenRemediationTicketInputOnly from the drawer, when the offer is not defaultsReady.
referenceUuidUUID!The plan's referenceUuid, as getRemediationResult shows.

Returns

OpenRemediationTicket

Example

mutation OpenRemediationTicket($alertId: UUID!, $referenceUuid: UUID!) {
  openRemediationTicket(alertId: $alertId, referenceUuid: $referenceUuid) {
    outcome
    message
  }
}

Types used only by openRemediationTicket

OpenRemediationTicket

Object type. Open a ticket from the alert's remediation plan through the account's Linear or Jira integration, or add a comment to the ticket the alert's issue already has. One ticket action per alert: a second call returns the existing ticket. Not idempotent on the ticket tool, so never retry it automatically.

FieldTypeDescription
outcomeTicketOutcome!
messageStringFixed text for the person when it didn't open one.
ticketRemediationTicket
OpenRemediationTicketInput

Input object type. What a person chose in the drawer when one click can't open the ticket.

FieldTypeDescription
ticketTitleStringThe ticket title; the plan's draft title if unset.
ticketDescriptionStringThe ticket description in Markdown; the plan's draft if unset.
linearTeamIdStringThe Linear team to open the ticket in.
jiraProjectIntThe Jira project id to open the ticket in.
jiraIssueTypeIntThe Jira issue type id.
TicketOutcome

Enum type. What one click on Open ticket or Add comment did.

ValueDescription
OPENED
COMMENTED
ALREADY_EXISTS
DEFAULTS_MISSING
NO_PERMISSION
NOT_CONNECTED
UPGRADE_REQUIRED
PLAN_NOT_READY
FAILED

Related types

RemediationTicket, UUID

rerunRemediationJob (mutation)

rerunRemediationJob is a mutation in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Re-run the failed job run an alert's remediation plan offers to re-run

Arguments

ArgumentTypeDescription
alertIdUUID!The alert the plan is for.
referenceUuidUUID!The plan's referenceUuid, as getRemediationResult shows.

Returns

RerunRemediationJob

Example

mutation RerunRemediationJob($alertId: UUID!, $referenceUuid: UUID!) {
  rerunRemediationJob(alertId: $alertId, referenceUuid: $referenceUuid) {
    outcome
    message
  }
}

Types used only by rerunRemediationJob

RemediationRerunOutcome

Enum type. What one click on Re-run failed job did. STARTED: this call re-ran the failed run, or asked
for it. ALREADY_EXISTS: the failed run already has a re-run, or one is being requested.
SUPERSEDED: the failed run has since succeeded, or a newer run of the job started, see
message. NO_PERMISSION: the caller may not re-run this job. NOT_AVAILABLE: Monte Carlo cannot
re-run the job for this alert, see message. PLAN_NOT_READY: the plan changed or has no re-run
marker. MAYBE_STARTED: the call may have reached the job's system, so the re-run may have
started: check the job's runs and do not retry. FAILED: nothing was started.

ValueDescription
STARTED
ALREADY_EXISTS
SUPERSEDED
NO_PERMISSION
NOT_AVAILABLE
PLAN_NOT_READY
MAYBE_STARTED
FAILED
RerunRemediationJob

Object type. Re-run the failed run of the job the alert's remediation plan offers to re-run, in the job's own system, as the calling user. One re-run per failed run: a second call, or a call for another alert on that run, starts nothing and returns the existing one. Never retry it automatically: MAYBE_STARTED means it may have started.

FieldTypeDescription
outcomeRemediationRerunOutcome!
messageStringFixed text for the person when the call has no re-run to show.
rerunRemediationRerunThe recorded re-run of the failed run: the one this call started, or the one it already had. Null when there is none, or while another call is requesting it.

Related types

RemediationRerun, UUID

startRemediation (mutation)

startRemediation is a mutation in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Build a remediation plan from an alert's current troubleshooting analysis

Arguments

ArgumentTypeDescription
alertIdUUID!UUID of the alert to build the remediation plan for

Returns

RemediationResult

Example

mutation StartRemediation($alertId: UUID!) {
  startRemediation(alertId: $alertId) {
    status
    tsaRunId
    title
    summary
    instructions
    recommendedActions
    responseTypes
    referenceUuid
    graphVersion
    drafted
    confidence
    cause
    provenance
    tuningMonitorUuid
    tuningRunUuid
    plan
  }
}

Related types

RemediationResult, UUID

Source: The GraphQL API reference

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