Backstage Cost Insights
In this tutorial, you'll learn about Backstage Cost Insights Shows Zero Data. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
Cost Insights shows zero data or stale metrics for your cloud accounts.
Wrong ❌
# app-config.yaml
costInsights:
# Missing products configuration
metrics:
dailyCost:
query: cost_daily
Wrong Output
Cost Insights dashboard:
"No data available for the selected time period."
Product panels are empty with loading spinners that never resolve.
Right ✅
# app-config.yaml
costInsights:
products:
- name: Compute
aggregation: daily
query: compute_cost_daily
- name: Storage
aggregation: daily
query: storage_cost_daily
- name: Network
aggregation: daily
query: network_cost_daily
metrics:
dailyCost:
query: cost_daily
computeUtilization:
query: compute_utilization
currencies:
- type: USD
label: USD
Right Output
Cost Insights dashboard displays:
Monthly Cost: $12,450.32 (↑ 8.2% vs last month)
Compute: $8,200 | Storage: $2,100 | Network: $1,800
Projects: 12 monitored
Prevention
- Verify that the BigQuery or cloud cost data source is configured and populated.
- Ensure the costInsights.products list matches the actual data available in the data source.
- Check that the IAM service account has access to the billing export dataset.
- Test queries manually in BigQuery before configuring in the plugin.
- Set up daily cost data ingestion for accurate historical comparisons.
DodaTech applies similar defensive patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro infrastructure for production reliability.
Common Mistakes with cost insights
- Forgetting
deriving (Show, Eq)on custom data types needed for debugging - Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
- Using
headandtailinstead of pattern matching, causing runtime errors on empty lists
These mistakes appear frequently in real-world BACKSTAGE code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
This quick fix is part of the DodaTech infrastructure engineering series. Learn more at DodaTech tutorials.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro