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

[COST-5923] OCP virtual machine distributed cost SQL #5517

Merged
merged 7 commits into from
Feb 26, 2025
Merged

Conversation

maskarb
Copy link
Member

@maskarb maskarb commented Feb 24, 2025

Jira Ticket

COST-5923

Description

This change will add SQL for distributing costs on OCP VMs.

API changes are found here: #5512.

Testing

  1. ingest OCP ONPREM
  2. check reporting_ocp_vm_summary_p and see distributed costs:
# select cluster_id, namespace, node, vm_name, cost_model_rate_type, distributed_cost from org1234567_mskarbek.reporting_ocp_vm_summary_p where distributed_cost != 0 and namespace='Toronto' and usage_start >= '2025-02-01' ;
    cluster_id    | namespace |   node    |  vm_name  | cost_model_rate_type |  distributed_cost   
------------------+-----------+-----------+-----------+----------------------+---------------------
 my-ocp-cluster-3 | Toronto   | compute_1 | exclude_A | platform_distributed | 222.892651211214421
 my-ocp-cluster-3 | Toronto   | compute_1 | exclude_A | worker_distributed   | 370.231048111934664

Release Notes

  • proposed release note
* [COST-5923](https://issues.redhat.com/browse/COST-5923) OCP virtual machine distributed cost SQL

@maskarb maskarb requested review from a team as code owners February 24, 2025 20:33
@maskarb maskarb added the smoke-tests pr_check will build the image and run minimal required smokes label Feb 24, 2025
Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.1%. Comparing base (97adbb0) to head (01ae084).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5517     +/-   ##
=======================================
- Coverage   94.1%   94.1%   -0.0%     
=======================================
  Files        371     371             
  Lines      31569   31569             
  Branches    3385    3385             
=======================================
- Hits       29711   29710      -1     
- Misses      1205    1206      +1     
  Partials     653     653             

@lcouzens
Copy link
Contributor

One thing I just noticed is we are now getting an error on the VM's api
Exception Value: 'NoneType' object has no attribute 'items'
Perhaps in the OCP query handler def format_tags(self, tags_iterable): We just need to add an if tag: inside for tag in tags_iterable:

This is because we now have entries in the vm table that have null in the tags column.

@djnakabaale
Copy link
Contributor

One thing I just noticed is we are now getting an error on the VM's api Exception Value: 'NoneType' object has no attribute 'items' Perhaps in the OCP query handler def format_tags(self, tags_iterable): We just need to add an if tag: inside for tag in tags_iterable:

This is because we now have entries in the vm table that have null in the tags column.

@lcouzens that error is addressed in this pr #5515

@bacciotti bacciotti enabled auto-merge (squash) February 26, 2025 10:25
@bacciotti bacciotti merged commit 96dccda into main Feb 26, 2025
14 checks passed
@bacciotti bacciotti deleted the cost-5678-sql branch February 26, 2025 11:30
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.

4 participants