Phase 5: Platform Engineering

Cost visibility: tagging, attribution & showback dashboards

Intermediate ~2 min read
Think of it this way A friendly analogy. Read this if the technical version feels dense. Show Hide

Imagine your family has a big shopping list for all your school supplies for the year. There are pencils, notebooks, art supplies, a new backpack, and even a special science kit. When everything arrives, it's just a huge pile! It would be really hard to know exactly how much was spent on just art supplies versus everything needed for math, right? You'd just see one giant total on the receipt, and it would be tricky to figure out if you bought too many colored pencils or not enough glue sticks.

That's why grown-ups who build big online projects, like your favorite games or apps, do something super smart. When they use computer power and storage for their projects, they put special "stickers" on everything. These stickers are like little labels that say exactly what each part of the project is for. For example, a sticker might say Subject: 'Science', Team: 'Game Developers', Project: 'New Level Design', or Owner: 'Ms. Emily'. These stickers are really important because they tell you who's using what, and for which part of the big online project.

Once everything has its own special sticker, it becomes much easier to sort things out. Instead of a giant, confusing bill, you can now gather all the items with the Science sticker and see exactly how much money was spent on them. Then you can do the same for New Level Design and Game Developers. This way, you can tell if the science project is using a lot more computer power than the game design, or if Ms. Emily's team is spending more on storage than other teams. It helps everyone understand who is using which online resources and how much it's costing.

So, when people build these amazing online worlds and tools, they use these "stickers" to keep track of every bit of computer power and storage. This means they can easily see exactly where their budget is going, just like you could see how much was spent on your art supplies versus your math books. This helps them make sure they're spending money wisely, not wasting anything, and only paying for exactly what they need to keep your favorite apps and games running smoothly.

As a Site Reliability Engineer managing infrastructure, understanding where your budget goes is paramount. Cost visibility is the practice of making cloud spending transparent and digestible. The foundation of this transparency lies in tagging, which involves applying key-value metadata to your cloud resources (e.g., EC2 instances, S3 buckets, databases). Think of tags like project: 'ecommerce', team: 'platform', environment: 'production', or owner: 'jane.doe'. Consistent and well-defined tagging policies are critical, as they act as the raw data that allows you to slice and dice your infrastructure costs across various dimensions.

Once resources are consistently tagged, the next step is attribution. This is the process of linking specific cloud costs to the teams, projects, or business units responsible for them. Your cloud provider's billing reports can aggregate costs based on these tags, turning a monolithic cloud bill into a granular breakdown. Without proper attribution, cost optimization efforts often fall flat because no one truly owns the spending, making it difficult to identify waste or inefficient resource usage. Attribution empowers teams to see the direct financial impact of their infrastructure choices, fostering a sense of ownership and accountability.

Finally, showback dashboards are the visualization layer that presents attributed cost data to relevant stakeholders. These dashboards, whether built using native cloud provider tools (like AWS Cost Explorer, GCP Billing Reports), third-party FinOps platforms, or custom solutions (e.g., Grafana), display spending broken down by team, project, environment, or service. The goal of showback isn't necessarily to directly charge teams (that's "chargeback"), but to provide clear, actionable insights into their resource consumption and associated costs. By making this information readily available, SREs and engineering managers can drive informed decisions, identify cost anomalies, and encourage a culture of cost-awareness and optimization within their organization.

Key Takeaways

  • Tagging is the foundational practice for breaking down cloud costs into manageable categories.
  • Attribution links resource costs directly to the owning teams or projects, enabling accountability.
  • Showback dashboards visualize attributed costs, empowering teams to understand and optimize their spending.
  • Consistent and mandatory tagging policies are essential for accurate cost visibility and reporting.
  • Cost visibility transforms amorphous cloud bills into actionable data for SREs and engineering teams.

Code Example

hcl
resource "aws_instance" "web_server" {
  ami           = "ami-0abcdef1234567890" # Example AMI ID
  instance_type = "t3.micro"

  tags = {
    Name        = "product-api-instance"
    Project     = "product-catalog"
    Team        = "backend-services"
    Environment = "production"
    Owner       = "sre-team@example.com"
    CostCenter  = "CC12345"
  }
}

How this code works

This code defines an Amazon Web Services (AWS) EC2 virtual server instance, named web_server, and assigns critical metadata to it using tags. For a lesson on cost visibility, the primary job of this code is to demonstrate how to effectively categorize cloud resources so their costs can be easily tracked, attributed, and analyzed. It ensures that every dollar spent on this server can be linked directly to its purpose, team, and financial owner, supporting robust cost management dashboards.

The resource "aws_instance" "web_server" block specifies that an AWS EC2 instance is being created. Inside this block, ami and instance_type define the server's operating system image and its computational capacity, respectively. The most crucial part for cost visibility is the tags = { ... } block. This block is a collection of key-value pairs like Project = "product-catalog" and CostCenter = "CC12345". These tags are entirely custom and user-defined, which is a subtle but important detail: if an organization's specific tag keys (e.g., CostCenter versus cost_center) aren't consistently applied across all resources, cost reporting might become incomplete or inaccurate. These structured tags enable detailed cost attribution and showback reports in AWS.