We are at re:Invent 2026Book my merch
Cloud Intelligence™Cloud Intelligence™

Cloud Intelligence™

How to Validate AI Cost Attribution in a Production Environment

This page is also available in Deutsch, Español, Français, Italiano, 日本語, and Português.

Oct 16, 202611 min read
Gregory Wiedeman

About Gregory Wiedeman

Senior Cloud Architect I

Greg is a Cloud Architecture Strategist at DoiT International and holds an M.S. in Systems Engineering from Regis University. He specializes in cloud architecture, FinOps consulting, and technical advisory services—helping clients optimize infrastructure and make smarter build decisions. When he's not immersed in cloud cost strategies, he enjoys writing about AI governance for non-technical leaders, playing cornhole, or climbing Colorado's many 14ers.

My personal page

It is simple to demonstrate that one can assign costs to AI but hard to place trust in such an assignment.

A dashboard can show tokens, requests, or GPU usage; the difficulty is in finding out if these figures refer to the right customer, product feature, team, or agent and whether the totals match those that finance and engineering currently trust.

The article presents a practical approach to verifying the assignment of AI production costs. It is not intended to have a fully functional dashboard ready on the first day; instead, the aim is to establish a measurable chain of evidence that connects runtime activity to the business context.

Start with a definition of “correct”

We should first decide what kind of question the results are intended to answer before establishing an attribution system.

For example:

  • What is the cost on a per-customer basis for providing the service?
  • Which product features cause the models to spend the most money?
  • What is the cost of running each AI agent?
  • What are the workloads that are in common and causing the infrastructure costs?
  • What proportion of the spending within the scope is at the moment not assignable?

The questions relate to various aspects of attribution; although a team-level approach might be adequate for the purpose of showback, obtaining a per-customer view would require tenant identifiers, details regarding the feature, and a mapping between runtime identifiers and business names.

Before you look at the output, you must write down the validation criteria. A worthwhile validation plan should specify:

  • The workloads and providers in scope
  • The dimensions that must be visible
  • The source of truth for comparison
  • The time window being compared
  • The acceptable variance
  • The treatment of unattributed spend

Attribute™ assigns runtime consumption to various dimensions such as team, namespace, workload, model, feature, environment, tenant, or customer. The important choice is to select the dimensions that correspond to the business question rather than gathering every possible label.

1. Begin with a workload of limited scope

Do not start by validating an entire cloud estate. Instead, begin with a small, representative slice:

  • One production service
  • One model or gateway
  • One customer-facing feature
  • One Kubernetes namespace
  • One billing account or project

As the scope is restricted, any discrepancies can be identified, and it also provides the platform team with a reference result which can be extended in the future.

For the first test, capture the expected activity independently. Useful comparison data could include:

  • Provider usage or billing data
  • LLM gateway request and token counters
  • Application logs
  • Tenant or customer identifiers
  • Kubernetes workload metadata
  • GPU or compute utilization

It is not necessary for all the systems to employ the same terminology. All we want to do is understand the way in which the various systems relate to one another.

2. Make sure the attribution key stays visible at runtime

Failure in attribution usually starts before the cost is calculated; when the telemetry is collected the attribution key—that is, the identifier which is needed to tell one instance of usage apart from another—may be absent.

For each target dimension, answer three questions:

  • Which identifier refers to the customer, feature, or tenant?
  • Where in the request path does the identifier appear?
  • Can the runtime collector keep continuous watch over it?

For instance, a customer identifier might be included in an authenticated request, in a gateway header, in a database connection attribute, or in a field specific to the application; but if the identifier is present only in the application's memory and never passes through any observable boundary, then a different method of integration or instrumentation will have to be used.

That is why validation should start with the ability to see the key at runtime rather than with the total displayed on a dashboard; if the key cannot be reliably observed, the downstream allocation will still be incomplete even if the reporting layer is carefully configured.

Tags can't follow AI spend through shared GPUs and gateways. Read AI Features Have a Visibility Problem to see why runtime observability beats instrumentation. Download the ebook →

3. Set the limits of the collection

Attribute™ gathers information about runtime consumption at the kernel level by means of eBPF (extended Berkeley Packet Filter – a Linux kernel technology designed for low-overhead observability) and does not necessitate any modifications to the application code or to the application SDK. However, the collection boundary remains important.

Document:

  • Which clusters, hosts, or accounts are covered
  • Which workloads are included or excluded
  • Which operating systems and kernel versions are supported
  • Whether traffic is encrypted before it reaches the observable boundary
  • Whether shared infrastructure is inside the measurement scope

Before attribution modeling begins, DoiT's onboarding process includes a review of the cluster topology, a check that the kernel and operating system are compatible, a review of security requirements, and a look at the telemetry flow. For more information on the engagement model, refer to the Attribute overview documentation.

A useful coverage statement looks like this:

The validation includes the production inference namespace, the self-hosted gateway, and the associated GPU nodes from Monday at 00:00 UTC to Tuesday at 00:00 UTC, with development traffic, batch workloads, and pre-existing connections being excluded.

If clear boundaries are set, teams will not regard an intentionally partial result as broken, and will not treat an unmeasured area as having a cost of zero.

4. Create a mapping from identifier to business

Runtime telemetry often begins with technical identifiers:

  • Pod names
  • Container IDs
  • Namespace names
  • Model IDs
  • API keys
  • Tenant IDs
  • Service names

Finance and product teams need readable dimensions:

  • Customer name
  • Product feature
  • Business unit
  • Environment
  • Pricing tier
  • Owning team

Ensure that the mapping is clear and keep a copy of it; note who is responsible for it, when it was last updated, and specify what occurs when an identifier does not have a corresponding business record.

A mapping table should include at least the following columns, for example:

Runtime identifier Business dimension Owner Effective date Validation status
tenant-4821 Acme / Search Assistant Product Platform 2026-09-01 Confirmed
tenant-5177 ExampleCo / Document Review AI Applications 2026-09-01 Confirmed
tenant-unknown Unmapped Platform FinOps 2026-09-01 Investigate

The unmapped row is important. Hiding it creates the appearance of complete attribution while removing the evidence needed to improve coverage.

Want to see which customers cost you the most? Get Cost Per Customer: A FinOps Field Guide to Multi-Tenant Cloud Attribution, with working SQL for AWS, Google Cloud, and Azure. Download the guide →

5. Bring together the three views of the same activity

A reliable validation compares at least three perspectives:

  • Runtime activity — what the workload called or consumed
  • Provider or gateway usage — what the platform reports for tokens, requests, or compute
  • Attributed cost — how that usage is assigned to business dimensions

Compare the same time window and account for timing differences: billing exports could be delayed, gateway counters might interpret a request differently, and runtime telemetry might observe retries or cached calls differently from the provider's invoice.

Two simple metrics are useful:

Coverage = attributed in-scope spend / total in-scope spend

Variance = absolute (source total - attributed total) / source total

You need to keep an eye on the metrics day by day on the basis of the workload, since a general overall percentage might mask a serious issue involving a particular customer or feature.

When there is a mismatch, classify it instead of immediately changing the attribution rule:

  • Scope mismatch
  • Time-window mismatch
  • Provider billing delay
  • Missing runtime identifier
  • Unmapped identifier
  • Retry or duplicate request
  • Cached or asynchronous work
  • Unsupported traffic path

The classification process turns what should be a reconciliation exercise into a series of engineering tasks, and the following example shows how this reconciliation is carried out all the way through before edge-case testing is considered.

Cloud bill shouldn't be a mystery

One platform for AI and Cloud optimization.

Illustrative validation example

The example given below is only intended to be illustrative and is not based on the result of any actual customer.

A SaaS company wishes to work out the cost of its document-summary feature from each tenant's point of view, the feature making its requests through a shared LLM gateway which is running in Kubernetes.

The team establishes a validation period lasting 24 hours which includes one production namespace, one gateway, and two model providers, and then compares the gateway token counters, the provider usage, and the Attribute™ output.

Validation stage Result
Provider and gateway total $10,200 of in-scope AI usage
Spend attributed to known tenants $9,650
Unmapped or unattributed spend $550, or 5.4% of scope
Initial conclusion Attribution is useful, but not yet complete

The team investigates the discrepancy rather than treating it as a calculation error. It finds two causes:

  • The most recently launched tenant has runtime identifiers which are not listed in the business mapping.
  • A batch workload uses the same gateway but is situated outside the original namespace scope.

The team adds the missing tenant mapping, separates out the batch workload, and then carries out the comparison once again with the time windows aligned. This time, 99% coverage is obtained for the defined feature scope, the remainder of the variance being attributable to the timing of provider billing.

What is important is not the percentage itself. The team now has a consistent explanation of the figure, definite responsibility for any spending that hasn't been mapped, and a validation procedure it can use every time new tenants, models, or workloads are added.

Still seeing unallocated AI spend? Get 5 Reasons AI Costs Don't Add Up and see why tags and SDKs can't close the gap. Download the ebook →

6. Test the edge cases that distort unit economics

It is not sufficient simply to make a request, because production AI systems are capable of displaying behaviors that affect the apparent cost to a feature or to a customer. Test at least:

  • Retries after provider errors
  • Streaming responses
  • Cached prompts or responses
  • Batch requests
  • Multiple models behind one gateway
  • Human and agent-generated traffic
  • Shared GPU workloads
  • Long-lived database or gateway connections
  • Failover across providers

Java workloads should be given special consideration since kernel-level eBPF visibility is not adequate for TLS traffic that is encrypted within the Java platform, and that is why Attribute™ has developed a Java agent for this scenario. If readers want to know about the deployment modes that are supported, the limitations, and the checks they should carry out after installation, they should consult the Java Instrumentation Guide.

The question of validation isn't just about whether the sensor is running; it also involves whether the sensor observes the traffic that is relevant to this workload in the way that this workload actually operates.

7. Keep up the coverage as a means of exercising control

The quality of the attributions varies according to the environment, as gaps can occur after the initial deployment has been validated when new tenants, gateways, models, namespaces, or features are added.

Create a recurring review that checks:

  • Newly observed identifiers without mappings
  • Spend assigned to an unknown or shared dimension
  • Changes in attributed coverage
  • Unexpected changes in cost per request or feature
  • Workloads that stopped reporting
  • Differences between provider totals and attributed totals

View coverage as an operational metric rather than as a single achievement when implementing it.

A practical acceptance checklist

Before calling an attribution deployment production-ready, confirm:

  • The business questions together with the relevant dimensions have been recorded.
  • The precise scope and time frame are clearly defined.
  • The target identifier can be seen in the path of the runtime traffic.
  • The clusters, hosts, accounts and workloads are all recorded.
  • Runtime identifiers have business-readable names.
  • Spending that has not been mapped and not been attributed can be seen.
  • The runtime activity is reconciled with the data provided by the provider or gateway.
  • Retries, caching, streaming, and shared workloads have been tested.
  • Java TLS workloads have been properly evaluated.
  • There is a person responsible for coverage and variance together with a review schedule.

Conclusion

AI cost attribution is only valuable to the extent that people place sufficient trust in it and make decisions based on it.

The trust arises from a process that can be repeated; to do this, you need to specify the question, set limits on the scope, check that runtime visibility is available, link the technical identifiers to the business context, reconcile the different views, test the edge cases in production, and keep an eye on the coverage over time.

Attribute™ provides the runtime measurement layer for AI together with the shared infrastructure; nevertheless, the quality of the results is still determined by the attribution model, the collection boundary, and the related validation process.

For teams moving from aggregate AI bills to cost per customer, feature, or agent, validation is not the final step after deployment. It is the operating system for the measurement program.

Sources