Skip to content
GreenKube

Reports & Exports

GreenKube provides cost and estimated carbon data for historical analysis. Exports are inputs for further analysis, not a complete organizational emissions inventory.

The /report page in the web dashboard provides a visual interface:

  1. Pick a relative window or custom date range
  2. Optionally filter by namespace
  3. Choose aggregation granularity (hourly → yearly)
  4. Preview row count and totals
  5. Download CSV or JSON directly to your browser

When running as a service (greenkube start), metrics are collected every 5 minutes and stored in the database. Raw rows are compressed into hourly aggregates after 24 hours; the default raw-row retention is 7 days, while hourly aggregates are retained indefinitely by default. Report history therefore depends on the configured retention settings and available collected data.

Each report row includes per-pod data:

MetricUnitDescription
EnergyJoulesEstimated energy consumption
CO₂e (Scope 2)gramsOperational emissions from electricity
Embodied CO₂e (Scope 3)gramsHardware manufacturing emissions
Total CO₂egramsScope 2 + Scope 3
CostUSDAllocated infrastructure cost
CPU UsagemillicoresActual CPU utilization
CPU RequestmillicoresRequested CPU resources
Memory UsagebytesActual memory consumption
Memory RequestbytesRequested memory
Network Rx/TxbytesNetwork traffic in/out
Disk Read/WritebytesDisk I/O
RestartscountContainer restart count
Node—Node name and instance type
Zone—Electricity Maps carbon zone

Download comma-separated data for spreadsheet analysis from the dashboard’s Report page or /api/v1/report/export?format=csv.

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

SyntaxMeaning
1hLast 1 hour
6hLast 6 hours
24hLast 24 hours
7dLast 7 days
30dLast 30 days
3mLast 3 months
6mLast 6 months
1yLast 12 months
ytdYear-to-date
years=2024Full calendar year 2024 in the export API
start / endCustom date range in the dashboard or API

Use the dashboard’s granularity control or the export API’s aggregate=true&granularity=monthly parameters to select a supported grouping. Use aggregate=true&group_by=namespace to aggregate by namespace.

Filter by namespace in the Report page. For other filters, use the relevant metrics endpoints in the API Reference.

Terminal window
curl -O -J \
"http://greenkube:8000/api/v1/report/export?format=csv&years=2024&aggregate=true&granularity=monthly&group_by=namespace"

The exported values are estimates with data-source and allocation limitations; reconcile them with your organization’s other data before external use.

Terminal window
# Report preview (row count + totals)
GET /api/v1/report/summary?last=30d
# Download report file
GET /api/v1/report/export?format=csv&years=2024&aggregate=true&granularity=monthly
# Namespace breakdown
GET /api/v1/metrics/by-namespace?last=30d
# Pre-computed summary (cached, fast)
GET /api/v1/metrics/dashboard-summary

See the API Reference for complete endpoint documentation.