KubeHerodocs · v0.3.3

Metrics reference

The Prometheus series KubeHero exports, the recording rules and alerts the chart installs, and the collector's own health metrics.

KubeHero keeps Prometheus as your metrics TSDB. The collector exposes a small, stable set of chargeback series on /metrics (port 8081); the chart installs a ServiceMonitor, recording rules and alerts for kube-prometheus-stack. Everything richer — logs, profiles, flows, usage history, allocation over any window — lives in ClickHouse and is served by the APIs.

Chargeback series

Every series carries the chargeback labels below.

MetricTypeUnit
kubehero_pod_cost_usd_per_secondgaugeUSD per second attributed to the pod
kubehero_pod_recoverable_usd_per_secondgaugeUSD per second rightsizing could recover
kubehero_pod_cpu_millicoresgaugeCPU, millicores
kubehero_pod_gpu_util_ratiogaugeGPU utilization 0–1 (GPU pods only)
LabelFromExample
namespace, podthe podpayments, payments-worker-5c7b9d8f6-9tj2l
teamkubehero.io/team pod label (chargeback.teamLabel), namespace map, else unattributedpayments
cost_centerkubehero.io/cost-center pod labelfin-platform
nodepoolthe node's pool label (auto-detected for AKS / GKE / EKS, or chargeback.nodepoolLabel)gpu-a100
cloud, regionthe node's provider and topology.kubernetes.io/regionaws, us-east-1
gpu_kindGPU pods onlyA100 80GB
# $/hour per team, averaged over 5 minutes
sum by (team) (kubehero_pod_cost_usd_per_second) * 3600

Recording rules

Installed by the chart's PrometheusRule (prometheus.enabled: true, requires prometheus-operator CRDs):

RuleMeaning
kubehero:pod_cost_usd:rate1mper-pod $/minute
kubehero:team_cost_usd:rate1h / rate24h / rate30dper-team spend projected per hour / day / 30 days
kubehero:nodepool_cost_usd:rate1hper-nodepool $/hour
kubehero:cost_center_cost_usd:rate1hper-cost-center $/hour
kubehero:team_gpu_idle_cost_usd:rate1h$/hour teams spend on idle GPU
kubehero:team_recoverable_usd:rate1h$/hour recoverable by rightsizing, per team

Alerts

AlertFires when
KubeHeroTeamOverBudgetProjecteda team's 24h spend, projected over 30 days, exceeds its budget series for 15 minutes
KubeHeroGPUIdleExcessivea team spends more than $500/hour on idle GPU for an hour

These are Prometheus alerts for teams that alert from Prometheus. KubeHero's own alert engine covers logs, spend, budgets, anomalies, network and events without Prometheus.

Collector health

The collector also exports its own health on /metrics:

MetricWhat it tells you
kubehero_collector_podspods on this node the collector is tracking
kubehero_collector_leader1 on the elected leader (cluster-scoped scans)
kubehero_collector_scan_duration_seconds, kubehero_collector_scan_errors_totalcost scan timing and failures
kubehero_collector_items_sent_total, kubehero_collector_items_dropped_totalitems shipped / dropped
kubehero_collector_send_errors_total, kubehero_collector_payload_bytes_totalshipping errors and bytes
kubehero_collector_queue_items, kubehero_collector_queue_bytesin-memory queue depth (bounded)
kubehero_collector_last_success_timestamp_secondslast successful ship — alert on staleness
kubehero_collector_log_files, kubehero_collector_log_lines_read_total, kubehero_collector_log_bytes_read_totallog tailing
kubehero_collector_log_lines_dropped_total, kubehero_collector_log_lines_truncated_totalrate-limited and over-long lines
kubehero_collector_log_file_events_totalrotations, truncations, new files
kubehero_collector_profile_scrapes_totalpprof scrapes
kubehero_collector_events_emitted_totalcluster events emitted
kubehero_collector_ebpf_enabled, kubehero_collector_ebpf_attachedeBPF requested / actually attached
kubehero_collector_ebpf_totaleBPF subsystem counters (flows and profiles emitted, drain errors)
# a collector that hasn't shipped for 5 minutes
time() - kubehero_collector_last_success_timestamp_seconds > 300

# nodes where eBPF was requested but couldn't attach
kubehero_collector_ebpf_enabled == 1 and kubehero_collector_ebpf_attached == 0

Cardinality

The chargeback series are per pod: expect roughly one series per running pod per metric. Per-container, per-flow and per-log-line data never becomes Prometheus series — query it through the APIs.

On this page