Skip to content

clanker CLI GCP cost provider discards the BigQuery currency field and hardcodes USD #228

Description

@rafeegnash

Problem

GetCosts returns ProviderCost with Currency hardcoded to "USD" even though the BigQuery billing record struct parses a currency field. A EUR/GBP-billed GCP account is reported with foreign-currency amounts mislabeled USD, and the aggregator sums into a USD grand total with no normalization, compounding the error.

Where

  • internal/cost/gcp_provider.go:91
  • internal/cost/gcp_provider.go:101
  • internal/cost/aggregator.go:91
  • internal/cost/aggregator.go:168

Root cause

Parsed currency is never propagated to ProviderCost.Currency, and the aggregator does unit-agnostic summation with a hardcoded USD label.

How to fix

Propagate the parsed currency into ProviderCost.Currency and normalize/flag mixed currencies in internal/cost/aggregator.go before summing.

Acceptance criteria

clanker cost against a non-USD GCP billing export reports the correct currency for the GCP line item and does not silently add it to USD totals.

Severity: low · from holistic hardening review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions