Skip to main content

v1.7.3 — AI Diagnosis Overhaul + Auto-Collect Agents

· 6 min read

The AI Diagnosis feature has been completely revamped with 3 export formats (DOCX/Markdown/PDF), scheduled reports (weekly/biweekly/monthly), and 6 Auto-Collect agents that automatically gather data from multiple sources. The EKS pages also received major UX improvements including cluster access management, Describe panel, and Service Resources tab.

:::tip Key Changes AI Diagnosis Renewal · DOCX/MD/PDF Export · Scheduled Reports · 6 Auto-Collect Agents · FinOps MCP 5 Tools · EKS Cluster Access Management · Powerpipe Exit Code 2 Handling :::

AI Diagnosis Renewal​

The route has been renamed from /diagnosis to /ai-diagnosis, and the entire UI has been revamped.

Before / After​

ItemBefore (v1.7.2)After (v1.7.3)
Route/diagnosis/ai-diagnosis
NameComprehensive DiagnosisAI Diagnosis
ExportPPTXDOCX + Markdown + PDF
Scheduled Reports—Weekly/Biweekly/Monthly
S3 Upload—Auto-upload DOCX + MD

3 Export Formats​

DOCX — Professional A4 report via docx package:

  • Cover page (title, health score, account alias, date)
  • Table of contents (hyperlinks, Heading 1-3)
  • Section-specific accent colors (cost=green, security=red, network/EKS=purple, idle/MSK=orange)
  • Markdown parsing (headings, tables, lists, blockquotes, inline code/bold/italic)

Markdown — All sections concatenated into a single .md file.

PDF — Dedicated print page at /ai-diagnosis/report:

  • White background A4 layout with CSS @media print page breaks
  • "Print / Save as PDF" button triggers browser Print-to-PDF
// src/lib/report-docx.ts (key structure)
const doc = new Document({
sections: [
coverPage(title, healthScore, accountAlias, date),
tableOfContents(),
...sections.map(s => sectionPage(s, accentColor)),
],
});
const buffer = await Packer.toBuffer(doc);

Scheduled Reports​

ItemDescription
FrequencyWeekly / Biweekly / Monthly
TimezoneKST (UTC+9)
ConfigurationDay of week (0-6), day of month (1-28), hour (0-23)
Storagedata/report-schedule.json
Check intervalEvery 5 minutes
// src/lib/report-scheduler.ts
type Schedule = {
enabled: boolean;
frequency: 'weekly' | 'biweekly' | 'monthly';
dayOfWeek?: number; // 0=Sun ~ 6=Sat
dayOfMonth?: number; // 1~28
hour: number; // KST
language: 'ko' | 'en';
};

Toggle ON/OFF in the UI, set frequency/day/hour/language, and reports are automatically generated and uploaded to S3.

:::info S3 Upload DOCX and Markdown files are automatically uploaded to awsops-deploy-{accountId}/reports/. Download via Presigned URLs valid for 7 days. S3 PutObject/GetObject permissions are automatically added to the CDK stack. :::

6 Auto-Collect Agents​

Dedicated agents that automate data collection for the AI Diagnosis report. Each agent collects data from multiple sources in parallel and streams live status updates.

AgentSourcesCollected Data
EKS OptimizePrometheus + K8s + SteampipeCPU/memory usage, throttling, pod restarts, HTTP 5xx, node utilization
DB OptimizeSteampipe + CloudWatchRDS/ElastiCache/OpenSearch discovery + metric-based rightsizing
MSK OptimizeSteampipe + CloudWatch + PrometheusBroker metrics, message throughput, consumer lag, partition count
Idle ScanSteampipeUnattached EBS, gp2 volumes, unused EIPs, stopped EC2, 90+ day snapshots, unused SGs + cost estimation
Trace AnalyzeTempo/Jaeger + PrometheusPer-service error traces, slow traces (>500ms)
IncidentCloudWatch + K8s + PrometheusALARM state alarms, Warning events, HTTP 5xx spikes, CPU spikes, memory pressure
// src/lib/collectors/types.ts
export interface Collector {
collect(send: SendFn, accountId?: string, isEn?: boolean): Promise<CollectorResult>;
formatContext(data: CollectorResult): string;
analysisPrompt: string;
displayName: string;
}

:::tip Collector Pattern All agents implement the same Collector interface. collect() uses Promise.allSettled for parallel multi-source collection and delivers progress via SendFn callback. To add a new agent, just implement this interface. :::

FinOps MCP Lambda​

5 FinOps tools added to the Cost Gateway.

ToolSourceDescription
get_rightsizing_recommendationsCompute OptimizerEC2/RDS/ECS/Lambda rightsizing + monthly savings
get_savings_plans_recommendationsCost ExplorerSavings Plans purchase recommendations (1yr/3yr, No Upfront)
get_reserved_instance_recommendationsCost ExplorerRI purchase recommendations (EC2/RDS/ElastiCache/Redshift)
get_cost_optimization_hub_recommendationsCost Optimization HubUnified optimization recommendations (Rightsize/Stop/Upgrade/SP)
get_trusted_advisor_cost_checksTrusted AdvisorCost optimization category checks + flagged resources

All tools support cross-account queries via the target_account_id parameter.

EKS/K8s Major UX Improvements​

Cluster Access Management​

FeatureDescription
Access Status BadgePer-cluster "Access Entry" registration status
One-Click Registration"Register ViewPolicy" button auto-creates Access Entry + Policy
Connection DetectionDetects actual connectivity by checking context_name in K8s query results
CLI GuideShows EC2 Role ARN-based registration commands for unconnected clusters

New Features​

FeatureFileDescription
Describe PanelK9sDetailPanelJSONB detail view (labels, annotations, containers, volumes, conditions)
Service Resources Tabk8s.tsPer-service CPU/Memory bar charts (Pod selector join)
Cluster Filterk8s/page.tsxClick cluster cards to filter nodes/pods/events/services
StatsCard NavigationStatsCard.tsxNodes→/k8s/nodes, Pods→/k8s/pods, etc. click navigation
SQL Consolidationqueries/k8s.tsInline SQL moved to centralized query file + cache warmer

Bug Fixes​

  • external_ip → external_ips column name fix (services 0/0 bug)
  • EC2 IAM Role ARN truncation fix (SQL || operator filter conflict)
  • Prevent cluster filter toggle on Register click (stopPropagation)
  • Post-registration polling for connection verification (5 attempts × 3s)

Benchmark: Powerpipe Exit Code 2 Handling​

Powerpipe exits with exit code 2 when benchmark controls have alarms. This is expected behavior, but the previous code treated it as an error.

ItemBeforeAfter
Criteriaexit code === 0Output file exists + size > 0
Exit code 2ErrorNormal
# Ignore exit code, validate by output file
powerpipe benchmark run ... > "${tmpFile}" 2>"${errorFile}"; \
if [ -s "${tmpFile}" ]; then
mv "${tmpFile}" "${resultFile}" && echo "done" > "${statusFile}";
else
echo "error" > "${statusFile}";
fi

Infrastructure: S3 Report Upload + update-infra Script​

S3 Policy​

S3 permissions added to the EC2 role in the CDK stack:

// infra-cdk/lib/awsops-stack.ts
ec2Role.addToPolicy(new iam.PolicyStatement({
actions: ['s3:PutObject', 's3:GetObject'],
resources: [`arn:aws:s3:::awsops-deploy-${this.account}/reports/*`],
}));

update-infra Script​

00-update-infra.sh script for safe CDK stack updates without EC2 replacement:

  1. Read existing stack parameters — Preserve current CloudFormation values
  2. Reconstruct CDK context — Re-derive from live infrastructure (VPC, TGW, domain)
  3. cdk diff preview — Warn if EC2 would be replaced
  4. Deploy — Safe deployment with --no-rollback

Version Comparison​

Itemv1.7.2v1.7.3Change
Diagnosis route/diagnosis/ai-diagnosisRenamed
Export formatsPPTXDOCX + MD + PDF3 formats
Scheduled reports—Weekly/Biweekly/MonthlyNew
Auto-Collect—6 agentsNew
FinOps tools—5 MCP toolsNew
EKS accessManualOne-click registrationImproved
BenchmarkExit code dependentOutput file validationFixed

Key File Changes​

FileChange
src/app/ai-diagnosis/page.tsxDiagnosis page renewal (route change, schedule UI)
src/app/ai-diagnosis/report/page.tsxPDF print-friendly page
src/app/api/report/route.tsReport generation API (15 sections, S3 upload)
src/lib/report-docx.tsDOCX generator (cover, TOC, section styles)
src/lib/report-scheduler.tsScheduled report scheduler (5-min check)
src/lib/report-prompts.ts15 section-specific Bedrock analysis prompts
src/lib/report-generator.tsData collection orchestrator
src/lib/collectors/*.ts6 Auto-Collect agents
agent/lambda/aws_finops_mcp.pyFinOps MCP Lambda (5 tools)
src/app/api/benchmark/route.tsPowerpipe exit code 2 handling
src/lib/queries/k8s.tsK8s SQL query consolidation + Service Resources
src/components/dashboard/StatsCard.tsxClick navigation (href prop)
infra-cdk/lib/awsops-stack.tsS3 reports/* policy
scripts/00-update-infra.shSafe infrastructure update script