Skip to content

feat: GCP support — detection engine, LLM analyzer, and dashboard tab#5

Open
smahima27 wants to merge 1 commit into
feature/new-detectorsfrom
feature/gcp-support
Open

feat: GCP support — detection engine, LLM analyzer, and dashboard tab#5
smahima27 wants to merge 1 commit into
feature/new-detectorsfrom
feature/gcp-support

Conversation

@smahima27

Copy link
Copy Markdown
Collaborator

Summary

Adds full GCP cloud cost support to GhostBusters, based on Perforce's real SADA billing data ($359K/mo).


New files

gcp_detection_engine.py

Reads a SADA GCP billing CSV and runs 8 GCP-specific waste detectors:

Detector What it catches
detect_spend_spikes Services with >10% MoM increase (e.g. Claude Sonnet 4.5 +29%, Support +20%)
detect_sharp_drops Services that dropped >50% — possible accidental shutdowns
detect_ai_spend Aggregates all AI/LLM services (Claude, Vertex, Gemini) — flags spend % and growth
detect_ai_spike Individual AI services growing faster than threshold
detect_cud_opportunity CUD-eligible services (Compute, SQL, GKE) with low/no committed use discounts
detect_excessive_support Support cost > 3% of total spend
detect_logging_costs Cloud Logging > $5K/mo — review retention policies
detect_new_services Services appearing for first time this billing period
detect_unused_savings Large services with $0 savings programs applied

Results on Perforce SADA data:

  • 37 GCP services, $359,264/mo total spend
  • 20 findings, $109,417/mo additional opportunity ($1.3M/yr)

gcp_analyzer.py

Sends gcp_findings.json to Claude → produces gcp_report.json with:

  • Executive summary (CTO-level)
  • Ranked findings with gcp_action (GCP Console path or gcloud CLI command)
  • AI/LLM spend insight
  • SADA discount assessment
  • Quick wins

Dashboard changes (dashboard_AI.py)

Added AWS / GCP tabs at the top level. GCP tab includes:

Section Content
Metric cards Total GCP spend, SADA savings %, additional opportunity, annual opportunity
AI Summary Claude-generated executive summary of GCP findings
Service bar chart Top 10 GCP services by monthly spend
Stacked savings chart List cost vs actual spend vs SADA savings per service
MoM trend chart All services with >5% change, color-coded red/green
AI/LLM spend panel Breakdown of Claude, Vertex, Gemini spend with MoM % per model
Quick wins 3 GCP-specific zero-downtime actions
Findings cards All GCP findings with severity badges and gcloud CLI fixes
SADA assessment Claude's view on discount efficiency
GCP chatbot Separate AI chatbot context-aware of GCP data

How to run

# 1. Run GCP detection
.venv/bin/python gcp_detection_engine.py

# 2. Run GCP analyzer  
export ANTHROPIC_API_KEY=$(cat SM_api_key)
.venv/bin/python gcp_analyzer.py

# 3. Launch dashboard (shows both AWS and GCP tabs)
export ANTHROPIC_API_KEY=$(cat SM_api_key)
.venv/bin/streamlit run dashboard_AI.py

Or use env vars for custom paths:

GHOSTBUSTERS_GCP_CSV="your_sada_report.csv"
GHOSTBUSTERS_GCP_FINDINGS="gcp_findings.json"
GHOSTBUSTERS_GCP_REPORT="gcp_report.json"

- gcp_detection_engine.py: 8 GCP-specific detectors (spend spikes, AI/LLM cost,
  CUD opportunity, sharp drops, logging costs, support overhead, new services)
- gcp_analyzer.py: sends GCP findings to Claude → gcp_report.json
- dashboard_AI.py: AWS/GCP tabs — GCP tab shows spend, savings, MoM trends,
  AI cost breakdown, findings cards, SADA discount assessment, GCP chatbot
- Perforce SADA data: 37 services, $359K/mo, 20 findings, $109K/mo opportunity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant