Lesson 1 of 3 Collecting and Analyzing Cost Data

Data Collection and Ingestion

Before cost data can drive decisions, it must be collected, cleaned and combined. This lesson describes a typical cost data pipeline, normalization and enrichment, and the quality checks that make the data trustworthy.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the stages of a cost data pipeline.
  • Explain normalization and enrichment of billing data.
  • Explain how storage format and partitioning affect query cost.
  • Compare building and buying a cost data platform.
  • Identify data quality checks for a cost pipeline.

A typical pipeline

Most organizations build or buy a pipeline with the same stages. The following steps describe them.

  1. Export

    Each provider writes billing exports to object storage on a schedule, often several times a day.

  2. Catalog

    A catalog defines tables and partitions over the files, for example by billing period, so they can be queried.

  3. Normalize

    Data from each source is converted to a common schema, ideally FOCUS, with consistent currencies, time zones and names.

  4. Enrich

    Ownership, business metrics, allocation rules and shared cost splits are added.

  5. Serve

    Dashboards, reports, alerts and APIs deliver the data to engineers, finance and leadership.

On AWS, for example, AWS Data Exports writes files to Amazon S3, the AWS Glue Data Catalog defines the tables and Amazon Athena queries them. Commercial FinOps platforms perform the same stages as a service.

Put in order

A cost data pipeline

Exam skills 2.2.1

Put the stages of a cost data pipeline in order.

Log in to try this activity Interactive activities are free with an account.

Normalization

Each provider names and structures billing data differently, so combining them requires normalization. Column names are mapped to a common schema, values are mapped to common categories (each provider's word for a usage charge or a purchase), currencies are converted with agreed rates, and timestamps are aligned to one time zone. FOCUS provides the common schema, and native FOCUS exports remove most of the work.

Enrichment

Raw billing data rarely says which team or product a cost belongs to beyond its tags and account. Enrichment adds that context: mapping accounts and tag values to teams and cost centers from an account registry or CMDB, applying shared cost rules, and joining business metrics such as orders per day for unit economics. Enrichment rules should be version-controlled, because a changed mapping changes every report built on it.

Data quality

A pipeline is only trusted if its output is shown to be complete and correct. The following list describes the most useful checks.

  • Reconciliation: billed cost per billing period matches each provider's invoice.
  • Completeness: every expected day and account is present.
  • Duplicates: a restated period has replaced, not added to, the earlier version.
  • Allocation coverage: the share of cost with an owner is measured and trending upward.

The following diagram compares appending each delivery with replacing by period.

Why appending restated billing data doubles a period's total. Providers deliver updated versions of a period's billing data, and a pipeline that appends each version counts every row twice. Loading by period, replacing the period's partition, and reconciling to the invoice automatically prevents and catches the error.
Reconciling to the invoice catches errors like this one.
Troubleshooting scenario

Pipeline problems

Exam skills 2.2.1

Find the cause of a common cost pipeline error.

Log in to try this activity Interactive activities are free with an account.

Storage format and query cost

Billing data for a large organization can reach billions of rows a year, and querying it has its own cost. Exports in a columnar format such as Apache Parquet are compressed and let a query engine read only the columns a query uses. Partitioning by billing period, and sometimes by account, lets the engine skip files outside the requested months. A query engine that charges per gigabyte scanned, such as Amazon Athena, can cost many times more on uncompressed, unpartitioned CSV files than on partitioned Parquet.

Dashboards that run the same heavy query repeatedly should read from pre-aggregated tables, such as daily cost by team and service, refreshed after each export, rather than scanning the raw data every time a page loads.

Build or buy

Organizations can build the pipeline themselves with provider services and open-source tools, or buy a commercial FinOps platform. Building gives full control and can be inexpensive in infrastructure, but requires engineering time to develop and maintain, especially for several providers whose formats change. Buying gives multi-cloud ingestion, allocation and dashboards quickly, at a license cost that is often a percentage of cloud spend.

Many organizations combine both: a platform for standard reporting and the raw exports in their own data warehouse for custom analysis. Whichever approach is used, FOCUS-formatted data reduces the work and makes it easier to change tools later.

Worked example

The doubled month

After a pipeline change, March's total cost in the dashboard is almost exactly twice the invoice. What is the likely cause?

The provider delivered an updated version of March's billing data, and the pipeline appended it instead of replacing the earlier version, so every March row appears twice. The fix is to load billing data by period, deleting or overwriting the period's partition before loading the new version, and to add a reconciliation check against the invoice so the error is caught automatically.

Worked example

Two providers, two currencies

A company combines AWS data billed in US dollars with Azure data billed in euros. Its combined report adds the cost columns directly. What is wrong?

Costs in different currencies cannot be added. Each row should keep its billing currency, and the pipeline should convert to a reporting currency using a rate agreed with finance, such as a monthly corporate rate, storing both the original and converted values. FOCUS includes a BillingCurrency column for this reason.

Check yourself

What should a pipeline do when the provider delivers a new version of a billing period it already loaded?

Show answer

Replace the whole period (overwrite its partition) rather than append rows; appending would count the period twice. A reconciliation check against the invoice confirms the result.

Exam Tips

Remember for the exam

  • Pipeline stages: export, catalog, normalize, enrich, serve.
  • Normalize column names, values, currencies and time zones before combining sources.
  • Version-control enrichment rules, because they change every report.
  • Reconcile with invoices and replace restated periods to keep data trustworthy.