Skip to content

Commit d7cb872

Browse files
authored
EC2 Previous Generation Coverage and EC2 Spot Coverage must be computed against ec2_usage_cost, not ec2_all_cost. (#1212)
1 parent 5280a23 commit d7cb872

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

cid/builtin/core/data/datasets/kpi/kpi_tracker.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
"Type": "DECIMAL",
4949
"SubType": "FLOAT"
5050
},
51+
{
52+
"Name": "ec2_usage_cost",
53+
"Type": "DECIMAL",
54+
"SubType": "FLOAT"
55+
},
5156
{
5257
"Name": "ec2_spot_cost",
5358
"Type": "DECIMAL",
@@ -397,6 +402,7 @@
397402
"linked_account_id",
398403
"spend_all_cost",
399404
"ec2_all_cost",
405+
"ec2_usage_cost",
400406
"ec2_spot_cost",
401407
"ec2_spot_potential_savings",
402408
"ec2_previous_generation_cost",

cid/builtin/core/data/queries/kpi/last_kpi_tracker_view.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SELECT DISTINCT
66
, spend_all.spend_all_cost
77
, spend_all.tags_json
88
, instance_all.ec2_all_cost
9+
, instance_all.ec2_usage_cost
910
, instance_all.ec2_spot_cost
1011
, instance_all.ec2_spot_potential_savings
1112
, instance_all.ec2_previous_generation_cost
@@ -94,6 +95,7 @@ LEFT JOIN (
9495
, linked_account_id
9596
, tags_json
9697
, "sum"("ec2_all_cost") "ec2_all_cost"
98+
, "sum"("ec2_usage_cost") "ec2_usage_cost"
9799
, "sum"("ec2_spot_cost") "ec2_spot_cost"
98100
, "sum"("ec2_spot_potential_savings") "ec2_spot_potential_savings"
99101
, "sum"("ec2_previous_generation_cost") "ec2_previous_generation_cost"

dashboards/kpi_dashboard/kpi_dashboard.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ dashboards:
573573
Expression: ({EC2 Graviton Coverage})/{EC2 Graviton Goal }
574574
Name: EC2 Graviton Trend
575575
- DataSetIdentifier: kpi_tracker
576-
Expression: SUM({ec2_previous_generation_cost})/SUM({ec2_all_cost})
576+
Expression: SUM({ec2_previous_generation_cost})/SUM({ec2_usage_cost})
577577
Name: EC2 Previous Generation Coverage
578578
- DataSetIdentifier: kpi_tracker
579579
Expression: max(${EC2PreviousGeneration})/100
@@ -587,7 +587,7 @@ dashboards:
587587
Expression: '{EC2 Previous Generation Goal}/{EC2 Previous Generation Coverage}'
588588
Name: EC2 Previous Generation Trend
589589
- DataSetIdentifier: kpi_tracker
590-
Expression: SUM({ec2_spot_cost})/SUM({ec2_all_cost})
590+
Expression: SUM({ec2_spot_cost})/SUM({ec2_usage_cost})
591591
Name: EC2 Spot Coverage
592592
- DataSetIdentifier: kpi_tracker
593593
Expression: max(${EC2SpotGoal})/100

0 commit comments

Comments
 (0)