costBuddy icon indicating copy to clipboard operation
costBuddy copied to clipboard

All panels are not aggregated with multi-account configuration

Open avishayil opened this issue 4 years ago • 3 comments

Describe the bug AWS Service Monthly Cost Spend dashboard panel & all other default panels after deployment are not aggregated with multi-account configuration, displays service spend legend per account.

To Reproduce Steps to reproduce the behavior. For example:

  1. Configure multiaccount according to the steps in the Readme.
  2. Launch Grafana UI.

Expected behavior AWS Service Monthly Cost Spend (and other panels) will display the data aggregated by AWS service name, legend per service name that aggregates all information from all accounts, and not legend per service per account.

Screenshots Screen Shot 2020-07-15 at 15 33 49

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: Not applicable

avishayil avatar Jul 15 '20 12:07 avishayil

Fix: Alter the query from:

sum(ce_aws_service_monthly_spend{account_id=~'$account_id', month='$month', year='$year'}) by (aws_service, account_id) - (sum(ce_aws_service_monthly_spend{account_id=~'$account_id', year='$year', month='$month'}) by (aws_service, account_id)/100 * $discount)

to:

sum(ce_aws_service_monthly_spend{account_id=~'$account_id', month='$month', year='$year'}) by (aws_service) - (sum(ce_aws_service_monthly_spend{account_id=~'$account_id', year='$year', month='$month'}) by (aws_service)/100 * $discount)

avishayil avatar Jul 15 '20 13:07 avishayil

I created PR #11 to handle this

avishayil avatar Jul 15 '20 14:07 avishayil

Thanks @avishayil , We will review the PR.

khilawar4 avatar Jul 16 '20 06:07 khilawar4