Autonomous FinOps Sentinel: Orchestrating TimescaleDB Anomaly Detection with Google Gemini AI in Kestra
说明与用途
Autonomous FinOps Sentinel 结合 TimescaleDB、Google Gemini 和 Kestra,实现实时检测费用异常,利用 AI 诊断根本原因,并向 Slack 发送上下文化警报,减少调查时间并消除警报噪声。
问题
End‑of‑month cloud billing surprises caused by uncoordinated resource provisioning, alert fatigue from static thresholds, and lack of contextual insight into spending spikes.
结果
The sentinel detects spending spikes in sub‑millisecond time, provides AI‑generated remediation steps, and sends severity‑based Slack alerts, cutting on‑call investigation time and eliminating alert fatigue.
工作流
- Trigger hourly schedule in Kestra
- Query TimescaleDB continuous aggregates to compute rolling mean, variance, and z‑score for each spend category
- If z‑score exceeds threshold, build anomaly JSON payload
- Send payload to Google Gemini 1.5 Flash for structured root‑cause analysis
- Receive JSON with severity, summary, remediation_action, urgency_score
- If severity is CRITICAL or HIGH, record incident in Kestra KV store and send Slack Block Kit alert; otherwise log nominal status
证据
It creates a real‑time, automated financial surveillance system that monitors cloud spending timeseries in TimescaleDB Continuous Aggregates (CAGGs), detects statistical spending spikes, invokes Google Gemini 1.5 Flash for contextual root‑cause diagnosis, and orchestrates remediation alerts directly into Slack.
Uncoordinated Provisioning: A developer spins up on‑demand GPU clusters (p4d.24xlarge) or an unthrottled LLM embedding pipeline, forgetting to terminate it on Friday night.
The workflow triggers at the top of every hour (io.kestra.plugin.core.trigger.Schedule). It calculates rolling standard deviations over recent hourly buckets from Timescale continuous aggregates:
json { "severity": "CRITICAL", "summary": "Cloud Infrastructure spend surged by 470% (Z-Score: 4.2) due to uncoordinated on‑demand GPU instance provisioning.", "remediation_action": "Audit active AWS us-east EC2 clusters and terminate orphaned p4d.24xlarge on‑demand instances immediately.", "urgency_score": 9 }
- 记录日期: 2026-10-15T00:56:08.065Z