メインコンテンツへスキップ

get-anomaly-explanation

dci get-anomaly-explanation <id>

Returns a likely-cause explanation for the specified anomaly, alongside the deterministic facts and evidence references it was generated from. The explanation itself is AI-generated; it is always returned separately from the deterministic facts, and is marked as such in the explanation object. Generation is ephemeral: no conversation is persisted on your behalf.

  • id — A unique identifier of the anomaly.

Output

OK - Anomaly explanation returned.

By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.

FieldTypeDescription
factsobjectDeterministic facts about the anomaly, not AI-generated.
facts.serviceNamestringService name
facts.platformstringCloud Provider name
facts.scopestringScope: Project or Account
facts.severityLevelstringSeverity level: information, warning, or critical.
facts.costOfAnomalynumber (double)The difference between the actual cost and the maximum cost in the normal range.
facts.actualCostnumber (double)Observed (actual) cost of the anomaly.
facts.expectedMaxCostnumber (double)Maximum cost within the expected normal range.
facts.top3SKUsarray of objectArray of SKU entries contributing to an anomaly.
facts.top3SKUs[].costnumber (double)
facts.top3SKUs[].namestring
evidencearray of objectCustomer-scoped identifiers the explanation was grounded in.
evidence[].typestringThe kind of evidence this reference points to.
evidence[].idstringIdentifier of the referenced evidence.
explanationobjectThe AI-generated portion of the response.
explanation.textstringConcise, likely-cause explanation of the anomaly.
explanation.generatedBystringIdentifies the system that generated the explanation.
explanation.aiGeneratedbooleanAlways true; present so consumers can identify AI-generated content explicitly.
Raw JSON schema
{
"required": [
"facts",
"evidence",
"explanation"
],
"type": "object",
"properties": {
"facts": {
"type": "object",
"description": "Deterministic facts about the anomaly, not AI-generated.",
"required": [
"serviceName",
"platform",
"scope",
"severityLevel",
"costOfAnomaly",
"top3SKUs"
],
"properties": {
"serviceName": {
"type": "string",
"description": "Service name"
},
"platform": {
"type": "string",
"description": "Cloud Provider name"
},
"scope": {
"type": "string",
"description": "Scope: Project or Account"
},
"severityLevel": {
"type": "string",
"description": "Severity level: `information`, `warning`, or `critical`."
},
"costOfAnomaly": {
"type": "number",
"format": "double",
"description": "The difference between the actual cost and the maximum cost in the normal range."
},
"actualCost": {
"type": "number",
"format": "double",
"nullable": true,
"description": "Observed (actual) cost of the anomaly."
},
"expectedMaxCost": {
"type": "number",
"format": "double",
"nullable": true,
"description": "Maximum cost within the expected normal range."
},
"top3SKUs": {
"type": "array",
"description": "Array of SKU entries contributing to an anomaly.",
"items": {
"type": "object",
"description": "SKU-level information contributing to an anomaly.",
"properties": {
"cost": {
"type": "number",
"format": "double"
},
"name": {
"type": "string"
}
}
}
}
}
},
"evidence": {
"type": "array",
"description": "Customer-scoped identifiers the explanation was grounded in.",
"items": {
"type": "object",
"required": [
"type",
"id"
],
"properties": {
"type": {
"type": "string",
"description": "The kind of evidence this reference points to."
},
"id": {
"type": "string",
"description": "Identifier of the referenced evidence."
}
}
}
},
"explanation": {
"type": "object",
"description": "The AI-generated portion of the response.",
"required": [
"text",
"generatedBy",
"aiGenerated"
],
"properties": {
"text": {
"type": "string",
"description": "Concise, likely-cause explanation of the anomaly."
},
"generatedBy": {
"type": "string",
"description": "Identifies the system that generated the explanation."
},
"aiGenerated": {
"type": "boolean",
"description": "Always true; present so consumers can identify AI-generated content explicitly."
}
}
}
}
}

Errors

On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.

HTTP status to exit code mapping
HTTP statusExit codeError codeMeaning
40030VALIDATION_ERRORThe arguments or request body were rejected. Review the command's flags and payload.
40110AUTHENTICATION_FAILEDNot signed in, or the API token is invalid. Run dci login or check DCI_API_KEY.
40311PERMISSION_DENIEDThe DoiT user or the active customer context does not have access.
40420RESOURCE_NOT_FOUNDThe requested resource does not exist. Check the identifier argument.
42950RATE_LIMITEDToo many requests. Retryable — the CLI reports the server-provided delay.
500, 50340API_SERVER_ERRORThe API failed to process the request. Retryable; contact DoiT support if it persists.

Aliases: getanomalyexplanation