Skip to content

Backstage Cost Insights

DodaTech 2 min read

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.
# 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

  1. Forgetting deriving (Show, Eq) on custom data types needed for debugging
  2. Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
  3. Using head and tail instead 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

**Q: What is the most common cause of this backstage error?**

A: Configuration drift between environments and version mismatches between the client and server are the top causes. Always verify both before deeper troubleshooting.

Q: Can this error affect production traffic?

A: Yes. Depending on whether the error occurs in the control plane or data plane, it can block all traffic or cause silent failures. Always test configuration changes in a staging environment first.

Q: How do I monitor for this error in production?

A: Set up log-based alerts for the error signature shown in the Wrong Output section. Prometheus, Grafana, and Datadog all support pattern matching on log entries.

Q: Is there a quick rollback procedure?

A: If you have the previous configuration version, revert and restart. For data-plane errors, replay affected records from the source of truth. Always version control your configuration.


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