Skip to content
GreenKube

Historical Analysis

GreenKube stores collected metrics over time for trend detection and capacity planning.

Every collection cycle captures a complete snapshot of your cluster:

  • Per-pod resource usage (CPU, memory, network, disk)
  • Per-node power and carbon estimation
  • Grid carbon intensity at collection time (zone-specific)
  • Cost data from OpenCost

These snapshots are stored in PostgreSQL or SQLite. Raw metrics are compressed to hourly aggregates after a configurable threshold (default: 24 h); raw rows are retained for 7 days by default, while hourly aggregates are retained indefinitely unless you configure a limit.

Query supported time windows through the API or dashboard:

Use the Report page for a relative or custom date range, or /api/v1/report/export?format=csv&years=2024 for an annual export.

Metrics can be grouped at different granularities:

GranularityUse Case
HourlyDetailed analysis, peak detection
DailyWeekly trends, daily reports
WeeklyMonth-over-month comparison
MonthlyAnnual comparisons
YearlyLong-term trend analysis

Set the granularity in the Report page or use the export API’s granularity parameter.

Group results by namespace for per-team cost and carbon allocation:

Select a namespace in the Report page or use aggregate=true&group_by=namespace on the export API.

Standard CSV output compatible with Excel, Google Sheets, and BI tools:

Download CSV from the Report page or /api/v1/report/export?format=csv.

Structured JSON for programmatic consumption:

Download JSON from the Report page or /api/v1/report/export?format=json.

Full access via REST API for integration with dashboards and pipelines:

Terminal window
# Time-series for charts
GET /api/v1/metrics/timeseries?last=30d&granularity=day
# Pre-computed dashboard cache (fastest)
GET /api/v1/metrics/dashboard-timeseries/30d
# Downloadable report
GET /api/v1/report/export?format=csv&years=2024&aggregate=true&granularity=monthly
# Per-namespace breakdown
GET /api/v1/metrics/by-namespace?last=30d

The web dashboard /report page provides a visual interface to:

  • Pick a time window or custom date range
  • Filter by namespace
  • Choose aggregation granularity
  • Preview row count and totals before downloading
  • Export directly to CSV or JSON in the browser

Compare modeled operational and embodied emissions by workload and namespace across time windows. Document the estimation method, fallbacks, and missing data before using these figures outside the engineering team.

Analyze historical trends to:

  • Predict future resource needs
  • Identify growth patterns
  • Plan infrastructure scaling

Break down cloud spending by:

  • Team / namespace
  • Application / service
  • Time period

Measure the impact of optimization actions:

  • Before/after comparison using custom date ranges
  • Savings ledger showing attributed savings from applied recommendations
  • ROI calculation on green initiatives

The dashboard includes interactive time-series charts with:

  • Drag-to-zoom on time ranges
  • Overlay comparison (this week vs. last week)
  • Stacked area/bar views for namespace breakdown
  • Real-time updates as new data arrives