Skip to content
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

Include provider in OCP/cloud tag sql params #5261

Merged
merged 11 commits into from
Aug 22, 2024
Merged

Conversation

lcouzens
Copy link
Contributor

@lcouzens lcouzens commented Aug 12, 2024

Jira Ticket

COST-####

Description

This change will add source_uuid to reporting_ocp{cloud}tags_summary.sql in order to reduce the select scale set. The more clusters/providers a customer has the slower this query is going to become.

Additionally fixed up some logging.

Testing

  1. Checkout Branch
  2. Restart Koku
  3. Hit endpoint or launch shell
    1. You should see ...
  4. Do more things...

Release Notes

  • proposed release note
* [COST-####](https://issues.redhat.com/browse/COST-####) Fix some things

@lcouzens lcouzens added the smoke-tests pr_check will build the image and run minimal required smokes label Aug 12, 2024
@lcouzens lcouzens changed the title Include provider in OCP/GCP sql params Include provider in OCP/GCP tag sql params Aug 12, 2024
@lcouzens lcouzens force-pushed the Improve-ocp-gcp-tag-sql branch from c937692 to db1aae3 Compare August 13, 2024 10:52
@lcouzens lcouzens force-pushed the Improve-ocp-gcp-tag-sql branch from db1aae3 to 88a972f Compare August 13, 2024 11:13
@lcouzens lcouzens marked this pull request as ready for review August 13, 2024 12:59
@lcouzens lcouzens requested review from a team as code owners August 13, 2024 12:59
Copy link

codecov bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.1%. Comparing base (01d3b3e) to head (72af472).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5261     +/-   ##
=======================================
- Coverage   94.1%   94.1%   -0.0%     
=======================================
  Files        375     375             
  Lines      31429   31429             
  Branches    4627    4627             
=======================================
- Hits       29573   29571      -2     
- Misses      1185    1187      +2     
  Partials     671     671             

@myersCody
Copy link
Contributor

For each ocp on cloud row, there are two bill ids associated with it.

  1. report_period_id (The OCP bill id)
  2. cost_entry_bill_id (The AWS bill id)

The question I have is why are we not filtering by the report_period_id within the tag summary sql?

We could pass in the current_report_period_id to the tag_information call, because the line right before it utilizes it.

Also, I am not sure if the title of this issue correctly describes all the changes being made in the PR. We are changing the tag sql params for all ocp on cloud providers.

@lcouzens lcouzens changed the title Include provider in OCP/GCP tag sql params Include provider in OCP/cloud tag sql params Aug 17, 2024
@lcouzens
Copy link
Contributor Author

For each ocp on cloud row, there are two bill ids associated with it.

1. report_period_id (The OCP bill id)

2. cost_entry_bill_id (The AWS bill id)

The question I have is why are we not filtering by the report_period_id within the tag summary sql?

We could pass in the current_report_period_id to the tag_information call, because the line right before it utilizes it.

Also, I am not sure if the title of this issue correctly describes all the changes being made in the PR. We are changing the tag sql params for all ocp on cloud providers.

Thats a reasonable suggestion that probably reduces the dataset down even more than just by cluster. 😄 Long as this SQL still works as expected with the smaller dataset I'm fine with that approach. I'll push that change up and we can give it a whirl. Thanks Cody!

@lcouzens lcouzens force-pushed the Improve-ocp-gcp-tag-sql branch from 81b1ccd to 145281c Compare August 17, 2024 11:21
@lcouzens lcouzens force-pushed the Improve-ocp-gcp-tag-sql branch from c552e22 to e0dc473 Compare August 17, 2024 15:47
@lcouzens lcouzens force-pushed the Improve-ocp-gcp-tag-sql branch from a9c72f3 to befd9d2 Compare August 18, 2024 08:57
@lcouzens lcouzens enabled auto-merge (squash) August 21, 2024 15:49
@lcouzens lcouzens disabled auto-merge August 21, 2024 16:23
@lcouzens lcouzens enabled auto-merge (squash) August 21, 2024 17:15
@lcouzens
Copy link
Contributor Author

/retest

@lcouzens lcouzens merged commit 976a0b9 into main Aug 22, 2024
11 checks passed
@lcouzens lcouzens deleted the Improve-ocp-gcp-tag-sql branch August 22, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
smoke-tests pr_check will build the image and run minimal required smokes smokes-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants