Skip to content
GreenKube

Multi-Resource Monitoring

GreenKube collects CPU, memory, network, disk, storage, and restart data from the supported Prometheus and Kubernetes sources. Only CPU usage currently feeds the energy and operational CO₂e model; the other measurements provide resource context and are available in metrics and reports.

  • Usage — CPU utilization per pod from Prometheus
  • Requests — CPU request values from Kubernetes pod specifications
  • Working set — Memory use reported by container_memory_working_set_bytes
  • Requests — Memory request values from Kubernetes pod specifications
  • Bytes transmitted and received — Per-pod network byte rates from Prometheus
  • Read throughput — Disk bytes read per second where Prometheus exposes the counter
  • Write throughput — Disk bytes written per second where Prometheus exposes the counter
  • PVC request and usage — Storage requests and used bytes where the required metrics are available
  • Orphaned PersistentVolumes — Recommendations for released volumes or volumes whose claim no longer exists
  • Restart count — Per-pod container restarts reported by Prometheus

Note: GPU use is not currently included in the energy model. Memory, network, disk, and storage metrics are also not converted into energy or CO₂e.

GreenKube collects metrics from multiple sources:

SourceMetrics
PrometheusCPU, memory, network, disk, PVC request/usage, restart counters
Kubernetes APIPod and node metadata, resource requests, HPA, health-verification data, PV and LoadBalancer cleanup inputs
OpenCostCost allocation data
Electricity Maps or WattnetGrid carbon intensity for supported zones
Boavizta APIHardware data used in embodied-emissions estimates
Prometheus ─┐
K8s API ────┼──→ Async Collector ──→ Processor ──→ Storage
OpenCost ───┤ │
Elec. Maps ─┘ Dashboard/API

The collection pipeline runs in phases: node discovery first (sequential), then zone resolution, then concurrent metrics collection via asyncio.gather, then carbon intensity prefetch and final assembly. This minimises overhead on your cluster.

  • Raw metrics (5-min) — Retained for 7 days (configurable via METRICS_RAW_RETENTION_DAYS)
  • Hourly aggregates — Kept indefinitely by default (configurable via METRICS_AGGREGATED_RETENTION_DAYS, default -1 = no limit) for historical analysis.
  • Compression — Raw rows are compressed into hourly aggregates after 24 hours (METRICS_COMPRESSION_AGE_HOURS)
  • Export — CSV/JSON for any time range via /api/v1/report/export