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-5328] Fully distribute network unattributed costs #5238

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

samdoran
Copy link
Contributor

@samdoran samdoran commented Jul 29, 2024

Jira Ticket

COST-5238
COST-3761

Description

Network unattributed costs are distributed in part by filtering for cost_category_id IS NULL in order to exclude Platform costs from Network unattributed. When putting network costs into their own project, the cost category ID is preserved. This results in some Network unattributed costs not being distributed to user projects.

Testing

  1. Checkout Branch
  2. Restart Koku
  3. Load test customer data with a cost model set to distribute network costs
  4. curl "http://localhost:8000/api/cost-management/v1/reports/openshift/costs/?filter%5Bresolution%5D=monthly&group_by%5Bproject%5D=network"
  5. Verify that data[0].projects[0].values[0].cost.total.value + data[0].projects[0].values[0].cost.network_unattributed_distributed.value = 0
JSON response snippet
...
                            "cost": {
                                "raw": {
                                    "value": 31.152,
                                    "units": "USD"
                                },
                                "markup": {
                                    "value": 3.1152,
                                    "units": "USD"
                                },
                                "usage": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "platform_distributed": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "worker_unallocated_distributed": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "network_unattributed_distributed": {
                                    "value": -34.2672,
                                    "units": "USD"
                                },
                                "storage_unattributed_distributed": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "distributed": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "total": {
                                    "value": 34.2672,
                                    "units": "USD"
                                }
...

Release Notes

  • proposed release note
* [COST-5328](https://issues.redhat.com/browse/COST-5328) Fully distribute Network unattributed costs

@samdoran samdoran added the aws-smoke-tests pr_check will build the image and run aws + ocp on aws smoke tests label Jul 29, 2024
@samdoran samdoran requested review from a team as code owners July 29, 2024 21:00
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.1%. Comparing base (e98441e) to head (5e8ca4b).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5238     +/-   ##
=======================================
- Coverage   94.1%   94.1%   -0.0%     
=======================================
  Files        373     373             
  Lines      31224   31224             
  Branches    4592    4592             
=======================================
- Hits       29383   29375      -8     
- Misses      1175    1181      +6     
- Partials     666     668      +2     

@samdoran samdoran force-pushed the COST-3761/COST-5328-distribute-unattributed-costs branch from d5612fc to 5e8ca4b Compare July 31, 2024 00:42
@samdoran samdoran merged commit ffb55fb into main Jul 31, 2024
11 checks passed
@samdoran samdoran deleted the COST-3761/COST-5328-distribute-unattributed-costs branch July 31, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-smoke-tests pr_check will build the image and run aws + ocp on aws smoke tests smokes-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants