-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[COST-4741] - Separate AWS node network costs into a Network unattributed namespace #5104
base: main
Are you sure you want to change the base?
Conversation
f358d79
to
6f1880b
Compare
a5fbc13
to
9f63a4c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5104 +/- ##
=====================================
Coverage 94.1% 94.1%
=====================================
Files 375 375
Lines 31170 31170
Branches 3730 3730
=====================================
+ Hits 29320 29321 +1
Misses 1180 1180
+ Partials 670 669 -1 |
bd7c5a0
to
f2312dc
Compare
- Add data transfer direction to daily summary - Separate node network costs out into network unattributed
f2312dc
to
2c0ded2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few quick questions/comments
WHEN position('in-bytes' IN lower(max(aws.lineitem_usagetype))) > 0 THEN 'IN' | ||
WHEN position('out-bytes' IN lower(max(aws.lineitem_usagetype))) > 0 THEN 'OUT' | ||
WHEN (position('regional-bytes' IN lower(max(aws.lineitem_usagetype))) > 0 AND position('-in' IN lower(max(lineitem_operation))) > 0) THEN 'IN' | ||
WHEN (position('regional-bytes' IN lower(max(aws.lineitem_usagetype))) > 0 AND position('-out' IN lower(max(lineitem_operation))) > 0) THEN 'OUT' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to use position
over strpos
when we've been using strpos
everywhere else in TrinoSQL files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason other than it's easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
literally everywhere else we use strpos...
WHEN (position('regional-bytes' IN lower(max(aws.lineitem_usagetype))) > 0 AND position('-out' IN lower(max(lineitem_operation))) > 0) THEN 'OUT' | ||
ELSE NULL | ||
END | ||
END AS data_transfer_direction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This SQL is grouped by these items below, are these enough to ensure a unique data_transfer_direction
or should we be grouping by the data_transfer_direction
result as well?
GROUP BY aws.lineitem_usagestartdate,
aws.lineitem_resourceid,
4, -- CASE satement
aws.product_productfamily,
aws.product_instancetype,
aws.lineitem_availabilityzone,
aws.product_region,
aws.resourcetags,
aws.costcategory
max(cluster_alias), | ||
max(data_source), | ||
'Network unattributed' AS namespace, | ||
max(node), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need the max here, this is grouped by node.
max(node), | |
node, |
CASE | ||
WHEN upper(data_transfer_direction) = 'IN' THEN usage_amount | ||
ELSE 0 | ||
END AS infrastructure_data_in_gigabytes, | ||
CASE | ||
WHEN upper(data_transfer_direction) = 'OUT' THEN usage_amount | ||
ELSE 0 | ||
END AS infrastructure_data_out_gigabytes, | ||
data_transfer_direction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking cause I'm not sure, are the units for the AWS data always in GB
?
Jira Ticket
COST-4741
Description
Separates out AWS node network costs into a separate project for later distribution.
Testing
Load OCP on AWS test data.
This is currently broken. You will need to run the second command twice.
Inspect data in Trino. Where product_family is
Data Transfer
andproduct_code
isAmazonEC2
, there should be a data transfer directionVerify there are records for Network unattributed in PostgreSQL AWS daily summary table
Verify OpenShift costs are correct
Verify AWS filtered by OpenShift costs are correct
Compare Trino and PostgreSQL data to make sure costs add up:
Release Notes