feat(backend): add root cause calculation
ci-agent / build (push) Has started running

This commit is contained in:
2026-04-05 08:22:41 +03:00
parent ad9d567d2c
commit 247505a310
4 changed files with 237 additions and 7 deletions
+83
View File
@@ -1085,6 +1085,55 @@
}
}
},
"/graph/failure": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "Analyzes dependencies and service statuses to find the root cause of a failure",
"produces": [
"application/json"
],
"tags": [
"graph"
],
"summary": "Find failure root cause",
"parameters": [
{
"type": "string",
"description": "Node ID (agent label)",
"name": "node_id",
"in": "query"
},
{
"type": "string",
"description": "Service name",
"name": "service",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/internal_handlers.FailureRootCauseOut"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/graph/order": {
"get": {
"security": [
@@ -2886,6 +2935,23 @@
}
}
},
"internal_handlers.FailureRootCauseOut": {
"type": "object",
"properties": {
"affected": {
"$ref": "#/definitions/internal_handlers.ServiceStatusOut"
},
"dependency_chain": {
"type": "array",
"items": {
"type": "string"
}
},
"root_cause": {
"$ref": "#/definitions/internal_handlers.ServiceStatusOut"
}
}
},
"internal_handlers.InsertLogRequest": {
"type": "object",
"required": [
@@ -3050,6 +3116,23 @@
"type": "string"
}
}
},
"internal_handlers.ServiceStatusOut": {
"type": "object",
"properties": {
"healthy": {
"type": "boolean"
},
"name": {
"type": "string"
},
"node_id": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"securityDefinitions": {