Skip to content

feat(analytics): implement dynamic cost and carbon factors with label-based attribution#307

Merged
victoriacheng15 merged 1 commit intomainfrom
feat/dynamic-finops-attribution
Mar 12, 2026
Merged

feat(analytics): implement dynamic cost and carbon factors with label-based attribution#307
victoriacheng15 merged 1 commit intomainfrom
feat/dynamic-finops-attribution

Conversation

@victoriacheng15
Copy link
Owner

Summary

Transformed the analytics service from static baselines to a dynamic, configuration-driven engine by externalizing energy cost and carbon intensity factors. Standardized feature attribution across the K3s infrastructure using consistent Kubernetes labels and updated Grafana dashboards to support real-time interactive parameter adjustments.

List of Changes

  • Refactored ThanosResourceProvider to load CARBON_INTENSITY_G_KWH and ENERGY_COST_CAD_KWH from environment variables with safe fallbacks and startup logging.
  • Enhanced analytics service attribution logic with expanded mappings for agentic infrastructure (MCP Hub) and standardized infrastructure tagging.
  • Applied app.kubernetes.io/feature labels to all core K3s manifests (Postgres, Loki, Tempo, Thanos, Otel) to ensure consistent telemetry discovery.
  • Decoupled Grafana dashboards from hardcoded constants by implementing template variables for cost and carbon factors, enabling interactive regional reporting.

Verification

  • Verified analytics service logs factor loading on startup via unit tests and manual log inspection.
  • Confirmed unit tests pass for the refactored analytics engine and service.
  • Validated JSON schema compliance for updated Grafana dashboards and K3s manifests.

@victoriacheng15 victoriacheng15 force-pushed the feat/dynamic-finops-attribution branch from f32d234 to 049ef0c Compare March 12, 2026 20:50
@victoriacheng15 victoriacheng15 merged commit 3a5cde5 into main Mar 12, 2026
4 checks passed
@victoriacheng15 victoriacheng15 deleted the feat/dynamic-finops-attribution branch March 12, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant