Metric

What is cost per service?

Definition

Cost per service breaks spend down by service — with a deliberate ambiguity to resolve first. Provider services (EC2, BigQuery) come free in every billing export; application services (checkout, search) are what engineering actually owns, and require mapping resources to services via tags, namespaces, or a service catalog.

Formula: Cost per service = sum of cost for resources mapped to the service, per period

What data do you need?

  • Billing rollups with provider service dimensions
  • A resource-to-application-service mapping (tags, namespaces, service catalog)
  • Kubernetes allocation rollups where services share clusters
  • Shared-infrastructure distribution rules for platform services
  • Usage drivers per service for unit-cost views

SQL pattern

Application-service cost joined from tags and allocationsPostgreSQL
SELECT
  date_trunc('month', usage_date) AS month,
  COALESCE(app_service, 'unmapped') AS app_service,
  ROUND(SUM(amortized_cost_usd), 2) AS cost,
  ROUND(
    100.0 * SUM(amortized_cost_usd)
    / NULLIF(SUM(SUM(amortized_cost_usd)) OVER (
        PARTITION BY date_trunc('month', usage_date)
      ), 0), 1
  ) AS share_pct
FROM cost_daily_rollups
GROUP BY 1, 2
ORDER BY 1, cost DESC;

Common pitfalls

Conflating provider services with application services.→ Label which view a card shows; 'EC2 is up 20%' and 'checkout is up 20%' are different conversations.
Leaving shared platform cost out of service totals.→ Distribute it by a stated rule or show it as its own service — silently dropping it understates everything.
Letting the service mapping rot.→ Services rename, split, and merge; version the mapping and review the 'unmapped' bucket monthly.

Where does this metric apply?

This metric commonly uses data from AWS Billing, Google Cloud Billing, Kubecost, Vantage, CloudZero, plus any warehouse models built on raw billing exports at the same grain.

Dashboards

Integrations

Metrics

Analytics

FAQ

How do I get application-service cost inside Kubernetes?
Namespace or label-level allocation from Kubecost or OpenCost maps workloads to services, then joins to the cloud bill share for the cluster. See the Kubernetes cost dashboard for the model.
Should cost per service include people costs?
For infrastructure dashboards, no — keep it to cloud and platform spend. Total cost of ownership including engineering time is a different analysis with much softer inputs; don't blend the two silently.