Cost Query Engine
BETA FEATURE - Cost Query Engine is fully functional but interface may evolve based on feedback.
Overview
Cost Query Engine enables advanced workload cost analysis through interactive filters:
- Filter Builder - Build complex queries with visual filter selection
- Multi-dimensional Analysis - Filter by cluster, namespace, workload type, cost, efficiency, labels
- Saved Queries - Save and reload filter combinations
- Visual Analytics - Cost trends, resource distribution charts, comparisons
- Export Results - Download filtered data as CSV
Philosophy: "Answer any cost question with visual filters, no SQL required."
Access: Select cluster (Clusters page or sidebar dropdown) → Cost Query Engine
Filter Types
Infrastructure Filters:
- Cluster - Filter by specific clusters
- Namespace - Limit results to namespaces
- Environment - Production, staging, development
- Architecture - amd64, arm64
Workload Filters:
- Workload Type - Deployment, StatefulSet, DaemonSet, Job
- HPA Status - Enabled or disabled autoscaling
- Labels - Filter by Kubernetes labels (key-value pairs)
Cost & Efficiency Filters:
- Cost Range - Minimum and maximum monthly cost
- Efficiency Range - Filter by resource efficiency percentage (0-100%)
Search & Sort:
- Search by workload name, cluster, or namespace
- Sort by cost, efficiency, replicas, or name
- Ascending or descending order
Building Queries
Step 1: Add Filters
- Click "Add Filter" button
- Select filter type from dropdown
- Configure values (multi-select for most types)
- Click "Add to Query"
- Filter appears in "Pending Filters" badge
Step 2: Run Query
- Review pending filters
- Click "Run Query" button
- Results appear in active tab
Step 3: Refine Results
- Add more filters to narrow results
- Remove filters by clicking X icon
- Use search bar for quick name filtering
Tabs
Overview:
- Cost trend chart (daily costs over time)
- Resource distribution pie chart (CPU, Memory, Storage)
- Summary statistics (total cost, potential savings)
Workloads:
- Detailed workload table with filtered results
- Columns: Name, Cluster, Namespace, Type, Cost, Efficiency
- Pagination with configurable items per page
- Click workload name to view details
Charts:
- Interactive visualizations of filtered data
- Bar charts, pie charts, area charts
- Customizable dimensions and metrics
Compare:
- Save filter sets as "Comparison Sets"
- Side-by-side comparison of different filter combinations
- Identify cost differences between environments or teams
Saved Queries
Save Current Query:
- Configure desired filters
- Click "Save Query" button
- Enter query name
- Query saved to browser localStorage
Load Saved Query:
- Click "Load Query" button
- Select from saved queries list
- Filters automatically applied
- Click "Run Query" to execute
Delete Query:
- Click trash icon next to saved query name
Export
Export to CSV:
- Run query with desired filters
- Click "Export" button
- Select "Download CSV"
- File includes all filtered workloads with full details
Export includes:
- Workload name, cluster, namespace, type
- CPU, memory, storage costs
- Efficiency metrics
- Labels and metadata
Common Workflows
Find Expensive Workloads in Production:
- Add filter: Environment = "production"
- Add filter: Cost Range > $1000/month
- Run Query
- Sort by cost descending
- Review top results in Workloads tab
Compare Team Costs:
- Add filter: Label = "team:backend"
- Run Query and save as "Backend Team"
- Clear filters
- Add filter: Label = "team:frontend"
- Run Query and save as "Frontend Team"
- Navigate to Compare tab to see side-by-side
Identify Low Efficiency Workloads:
- Add filter: Efficiency Range = 0-50%
- Add filter: Workload Type = "Deployment"
- Run Query
- Export results for optimization review