-
Notifications
You must be signed in to change notification settings - Fork 94
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
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% -0.0%
=======================================
Files 373 373
Lines 31217 31217
Branches 4591 4591
=======================================
- Hits 29378 29374 -4
- Misses 1172 1175 +3
- Partials 667 668 +1 |
bd7c5a0
to
f2312dc
Compare
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
koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql
Outdated
Show resolved
Hide resolved
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
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.
We do probably need to group by the direction, but we can't use an aggregation in a group by. Grouping by aws.lineitem_usagetype
may work.
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.
You can also use numbers to group by items in the SELECT
statement, for example the 4
in the group by there is based on the CASE
statement in the SQL
koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql
Outdated
Show resolved
Hide resolved
koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql
Show resolved
Hide resolved
2c0ded2
to
e75f201
Compare
e75f201
to
5f78bed
Compare
5f78bed
to
15ee674
Compare
60e2304
to
f75aad8
Compare
- Add data transfer direction to daily summary - Separate node network costs out into network unattributed
It’s not possible to use an aggregation in a GROUP BY statement, so grouping by the lineitem_usagetype is the closest I could think of. It may result in too many distinct rows, though.
Without this group by, the data transfer direction would not be accurate since the operation value may sometimes contain ‘-in’ and other times ‘-out’. This ensures we are getting the correct direction consistently. Co-authored-by: Corey Goodfred <[email protected]>
If set to 0, the records will be inserted twice into the network summary tables because that query is filtering on values where the field is not null, and zero is not null. Co-authored-by: Corey Goodfred <[email protected]>
f75aad8
to
ff66962
Compare
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