curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/aiinsights \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/aiinsights"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('{scheme}://{host}:{port}/{basePath}/aiinsights', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "{scheme}://{host}:{port}/{basePath}/aiinsights",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{scheme}://{host}:{port}/{basePath}/aiinsights"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{scheme}://{host}:{port}/{basePath}/aiinsights")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/aiinsights")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "AIInsightList",
"metadata": {
"totalCount": 1,
"page": 1,
"pageSize": 20
},
"items": [
{
"name": "payment-service-oom-kill-1773933600-insight",
"namespace": "production",
"issueRef": "payment-service-oom-kill-1773933600",
"provider": "CLAUDEAI",
"model": "claude-sonnet-4-6",
"analysis": "The payment-service deployment is experiencing OOMKill events. Root cause: memory leak in the webhook handler that fails to close HTTP response bodies on validation errors, causing heap accumulation. The leak correlates with a recent deployment (revision 42) that introduced the payment notification webhook handler.",
"confidence": 0.91,
"recommendations": [
"Increase memory limit from 512Mi to 1Gi as immediate mitigation",
"Restart pods to reclaim leaked memory",
"Review webhook handler code for unclosed response bodies"
],
"suggestedActions": [
{
"name": "Increase memory limit",
"action": "AdjustResources",
"description": "Increase memory limit to prevent further OOMKills while the code fix is deployed",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "Restart deployment",
"action": "RestartDeployment",
"description": "Restart pods to reclaim leaked memory immediately"
}
],
"logAnalysis": "1 Go panic stack trace detected; 12 critical error patterns (OOMKilled, memory allocation failure); Primary exception: runtime: out of memory",
"gitOpsContext": "Helm release 'payment' chart=payment-service version=2.3.1 status=deployed revision=42",
"cascadeAnalysis": "Cascade chain: production/payment-service(root_cause) -> production/api-gateway(victim). The api-gateway is receiving 503 responses from payment-service.",
"blastRadiusPrediction": "AdjustResources: Low risk. Affects 3 pods, 1 service (payment-svc). No PDB violations.",
"generatedAt": "2026-03-19T15:21:00Z",
"creationTimestamp": "2026-03-19T15:20:05Z"
}
]
}
Listar AI Insights
Retorna todos os insights gerados pela IA com análise de causa raiz, scores de confiança e ações de remediação sugeridas para cada incidente
curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/aiinsights \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/aiinsights"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('{scheme}://{host}:{port}/{basePath}/aiinsights', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "{scheme}://{host}:{port}/{basePath}/aiinsights",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{scheme}://{host}:{port}/{basePath}/aiinsights"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{scheme}://{host}:{port}/{basePath}/aiinsights")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/aiinsights")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "AIInsightList",
"metadata": {
"totalCount": 1,
"page": 1,
"pageSize": 20
},
"items": [
{
"name": "payment-service-oom-kill-1773933600-insight",
"namespace": "production",
"issueRef": "payment-service-oom-kill-1773933600",
"provider": "CLAUDEAI",
"model": "claude-sonnet-4-6",
"analysis": "The payment-service deployment is experiencing OOMKill events. Root cause: memory leak in the webhook handler that fails to close HTTP response bodies on validation errors, causing heap accumulation. The leak correlates with a recent deployment (revision 42) that introduced the payment notification webhook handler.",
"confidence": 0.91,
"recommendations": [
"Increase memory limit from 512Mi to 1Gi as immediate mitigation",
"Restart pods to reclaim leaked memory",
"Review webhook handler code for unclosed response bodies"
],
"suggestedActions": [
{
"name": "Increase memory limit",
"action": "AdjustResources",
"description": "Increase memory limit to prevent further OOMKills while the code fix is deployed",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "Restart deployment",
"action": "RestartDeployment",
"description": "Restart pods to reclaim leaked memory immediately"
}
],
"logAnalysis": "1 Go panic stack trace detected; 12 critical error patterns (OOMKilled, memory allocation failure); Primary exception: runtime: out of memory",
"gitOpsContext": "Helm release 'payment' chart=payment-service version=2.3.1 status=deployed revision=42",
"cascadeAnalysis": "Cascade chain: production/payment-service(root_cause) -> production/api-gateway(victim). The api-gateway is receiving 503 responses from payment-service.",
"blastRadiusPrediction": "AdjustResources: Low risk. Affects 3 pods, 1 service (payment-svc). No PDB violations.",
"generatedAt": "2026-03-19T15:21:00Z",
"creationTimestamp": "2026-03-19T15:20:05Z"
}
]
}
payment-service-oom-kill-1773933600)O Que São AI Insights?
Quando um incidente entra em análise, o operator cria um recurso AIInsight para ele, chamado<issue>-insight, e o preenche com a análise devolvida pelo servidor ChatCLI ao qual está conectado. provider e model são copiados da primeira Instance pronta (model fica vazio quando a Instance não define um). Isso inclui:
- Análise de causa raiz com score de confiança (
confidence, 0.0–1.0) - Recomendações em formato legível por humanos
- Ações sugeridas com parâmetros concretos (ex.:
ScaleDeploymentcomreplicas: "5") - Dados de enriquecimento (cada um só aparece quando coletado): análise de logs, métricas Prometheus, código-fonte, contexto GitOps, análise de cascata e previsão de raio de explosão
{
"apiVersion": "v1",
"kind": "AIInsightList",
"metadata": {
"totalCount": 1,
"page": 1,
"pageSize": 20
},
"items": [
{
"name": "payment-service-oom-kill-1773933600-insight",
"namespace": "production",
"issueRef": "payment-service-oom-kill-1773933600",
"provider": "CLAUDEAI",
"model": "claude-sonnet-4-6",
"analysis": "The payment-service deployment is experiencing OOMKill events. Root cause: memory leak in the webhook handler that fails to close HTTP response bodies on validation errors, causing heap accumulation. The leak correlates with a recent deployment (revision 42) that introduced the payment notification webhook handler.",
"confidence": 0.91,
"recommendations": [
"Increase memory limit from 512Mi to 1Gi as immediate mitigation",
"Restart pods to reclaim leaked memory",
"Review webhook handler code for unclosed response bodies"
],
"suggestedActions": [
{
"name": "Increase memory limit",
"action": "AdjustResources",
"description": "Increase memory limit to prevent further OOMKills while the code fix is deployed",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "Restart deployment",
"action": "RestartDeployment",
"description": "Restart pods to reclaim leaked memory immediately"
}
],
"logAnalysis": "1 Go panic stack trace detected; 12 critical error patterns (OOMKilled, memory allocation failure); Primary exception: runtime: out of memory",
"gitOpsContext": "Helm release 'payment' chart=payment-service version=2.3.1 status=deployed revision=42",
"cascadeAnalysis": "Cascade chain: production/payment-service(root_cause) -> production/api-gateway(victim). The api-gateway is receiving 503 responses from payment-service.",
"blastRadiusPrediction": "AdjustResources: Low risk. Affects 3 pods, 1 service (payment-svc). No PDB violations.",
"generatedAt": "2026-03-19T15:21:00Z",
"creationTimestamp": "2026-03-19T15:20:05Z"
}
]
}
Autorizações
API key sent in the X-API-Key header. Keys are read from the Secret chatcli-operator-secrets, key api-keys (fallback: ConfigMap chatcli-operator-config, key api-keys) in the operator namespace, as a YAML list of {key, role, name, description} (name is the identity recorded on approval decisions); the operator chart creates it only with apiKeys.create: true. Roles: viewer < operator < admin — any other role string is denied everywhere. Changes are picked up within about 30 seconds; deleting both the Secret and the ConfigMap revokes every key. With no keys configured every /api/ call returns 401, unless CHATCLI_OPERATOR_DEV_MODE=true, which grants admin without a key (development only).
Parâmetros de consulta
Kubernetes namespace. Empty means all namespaces.
Exact match on spec.issueRef.name.
Page number (1-based). Invalid values fall back to 1.
x >= 1Items per page. Values above 100 are capped at 100.
1 <= x <= 100