curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/analytics/compliance \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/analytics/compliance"
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}/analytics/compliance', 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}/analytics/compliance",
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}/analytics/compliance"
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}/analytics/compliance")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/analytics/compliance")
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": "ComplianceReport",
"spec": {
"Period": {
"Start": "2026-03-15T15:00:00Z",
"End": "2026-03-22T15:00:00Z"
},
"IncidentMetrics": {
"TotalIncidents": 45,
"BySeverity": {
"critical": 5,
"high": 12,
"medium": 18,
"low": 10
},
"ByState": {
"Resolved": 38,
"Escalated": 4,
"Analyzing": 3
},
"MTTD": 32000000000,
"MTTR": 510000000000,
"MeanRemediationAttempts": 1.8
},
"RemediationMetrics": {
"TotalRemediations": 52,
"SuccessRate": 88.4,
"ByActionType": {
"AdjustResources": {
"Count": 14,
"Success": 13,
"Failed": 1
},
"RestartDeployment": {
"Count": 9,
"Success": 7,
"Failed": 2
}
},
"AutoRemediatedCount": 38,
"AgenticCount": 27
},
"SLAMetrics": {
"CompliancePercentage": 91.1,
"ResponseSLAViolations": 0,
"ResolutionSLAViolations": 4,
"AverageResponseTime": 32000000000,
"AverageResolutionTime": 540000000000
},
"ApprovalMetrics": {
"TotalRequests": 14,
"AutoApproved": 8,
"ManualApproved": 4,
"Rejected": 1,
"Expired": 1,
"AverageDecisionTime": 190000000000
},
"AuditSummary": {
"TotalEvents": 310,
"BySeverity": {
"info": 280,
"warning": 27,
"critical": 3
},
"ByEventType": {
"issue_created": 45,
"remediation_completed": 38,
"approval_granted": 12
}
}
}
}
Compliance de Analytics
Retorna um relatório de compliance com métricas de incidentes, remediações, SLA, aprovações e auditoria para uma janela de tempo
curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/analytics/compliance \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/analytics/compliance"
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}/analytics/compliance', 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}/analytics/compliance",
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}/analytics/compliance"
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}/analytics/compliance")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/analytics/compliance")
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": "ComplianceReport",
"spec": {
"Period": {
"Start": "2026-03-15T15:00:00Z",
"End": "2026-03-22T15:00:00Z"
},
"IncidentMetrics": {
"TotalIncidents": 45,
"BySeverity": {
"critical": 5,
"high": 12,
"medium": 18,
"low": 10
},
"ByState": {
"Resolved": 38,
"Escalated": 4,
"Analyzing": 3
},
"MTTD": 32000000000,
"MTTR": 510000000000,
"MeanRemediationAttempts": 1.8
},
"RemediationMetrics": {
"TotalRemediations": 52,
"SuccessRate": 88.4,
"ByActionType": {
"AdjustResources": {
"Count": 14,
"Success": 13,
"Failed": 1
},
"RestartDeployment": {
"Count": 9,
"Success": 7,
"Failed": 2
}
},
"AutoRemediatedCount": 38,
"AgenticCount": 27
},
"SLAMetrics": {
"CompliancePercentage": 91.1,
"ResponseSLAViolations": 0,
"ResolutionSLAViolations": 4,
"AverageResponseTime": 32000000000,
"AverageResolutionTime": 540000000000
},
"ApprovalMetrics": {
"TotalRequests": 14,
"AutoApproved": 8,
"ManualApproved": 4,
"Rejected": 1,
"Expired": 1,
"AverageDecisionTime": 190000000000
},
"AuditSummary": {
"TotalEvents": 310,
"BySeverity": {
"info": 280,
"warning": 27,
"critical": 3
},
"ByEventType": {
"issue_created": 45,
"remediation_completed": 38,
"approval_granted": 12
}
}
}
}
from e to formam um período absoluto: com os dois, o relatório cobre exatamente [from, to]; só com from, vai até agora; só com to, são os 7 dias que terminam em to; sem nenhum, os últimos 7 dias.Conteúdo do relatório
Role mínima:viewer. São agregados os recursos criados dentro da janela:
- IncidentMetrics: total de Issues, por severidade e estado,
MTTD(detectedAt − creationTimestamp),MTTR(resolvedAt − detectedAt), média de tentativas de remediação - RemediationMetrics: total de planos,
SuccessRate(percentual, de 0 a 100, sobre planos que terminaramCompletedvsFailed/RolledBack), por tipo de ação,AutoRemediatedCount(planosCompleted),AgenticCount(planos agênticos) - SLAMetrics:
ResponseSLAViolationseResolutionSLAViolations,CompliancePercentage(fração de Issues sem violação; 100 quando não há nenhum), tempos médios de resposta e resolução. Com IncidentSLAs no escopo, uma violação é o que o controller de IncidentSLA registrou no Issue (platform.chatcli.io/sla-violated,responsee/ouresolution). Sem nenhuma IncidentSLA, um Issue no estadoEscalatedconta como violação de resolução e as violações de resposta ficam0. - IncidentSLAs: uma entrada por IncidentSLA no escopo (
Name,Namespace,Severity,ResponseTime,ResolutionTime,CompliancePercentage,ActiveViolations,TotalViolations,TotalIssuesTracked); omitido quando não há nenhuma - ApprovalMetrics: solicitações, aprovadas automática/manualmente, rejeitadas, expiradas, tempo médio de decisão
- AuditSummary: total de AuditEvents, por severidade e por tipo de evento
MTTD, MTTR, Average*Time) é um inteiro em nanossegundos. O MTTR aqui é medido a partir da detecção, enquanto /analytics/mttr mede a partir da criação do Issue.{
"apiVersion": "v1",
"kind": "ComplianceReport",
"spec": {
"Period": {
"Start": "2026-03-15T15:00:00Z",
"End": "2026-03-22T15:00:00Z"
},
"IncidentMetrics": {
"TotalIncidents": 45,
"BySeverity": {
"critical": 5,
"high": 12,
"medium": 18,
"low": 10
},
"ByState": {
"Resolved": 38,
"Escalated": 4,
"Analyzing": 3
},
"MTTD": 32000000000,
"MTTR": 510000000000,
"MeanRemediationAttempts": 1.8
},
"RemediationMetrics": {
"TotalRemediations": 52,
"SuccessRate": 88.4,
"ByActionType": {
"AdjustResources": {
"Count": 14,
"Success": 13,
"Failed": 1
},
"RestartDeployment": {
"Count": 9,
"Success": 7,
"Failed": 2
}
},
"AutoRemediatedCount": 38,
"AgenticCount": 27
},
"SLAMetrics": {
"CompliancePercentage": 91.1,
"ResponseSLAViolations": 0,
"ResolutionSLAViolations": 4,
"AverageResponseTime": 32000000000,
"AverageResolutionTime": 540000000000
},
"ApprovalMetrics": {
"TotalRequests": 14,
"AutoApproved": 8,
"ManualApproved": 4,
"Rejected": 1,
"Expired": 1,
"AverageDecisionTime": 190000000000
},
"AuditSummary": {
"TotalEvents": 310,
"BySeverity": {
"info": 280,
"warning": 27,
"critical": 3
},
"ByEventType": {
"issue_created": 45,
"remediation_completed": 38,
"approval_granted": 12
}
}
}
}
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.
Start of the time range (RFC3339). Unparseable values are ignored.
"2026-03-01T00:00:00Z"
End of the time range (RFC3339). Unparseable values are ignored.
"2026-03-19T23:59:59Z"