Metric

What is cost per service?

What does a cost per service chart look like in Metabase?

Chart one application service at a time so the platform total can't hide who is growing. Checkout's costs step down as rightsizing lands, while a jump like April's — a load-test cluster left running past its window — is exactly the kind of blip a per-service view catches and assigns to an owner.

Cost per service in Metabase: bar chart of monthly amortized cost for one application service.
Cost per service as a Metabase card, built from billing export data. Figures are illustrative.

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 allocations PostgreSQL
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.