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

node_cpu_hourly_cost value not reconciling with actual Azure Price Rates #2640

Open
danijam opened this issue Mar 15, 2024 · 3 comments
Open
Labels
E2 Estimated level of Effort (1 is easiest, 4 is hardest) kubecost Relevant to Kubecost's downstream project needs-follow-up needs-triage opencost OpenCost issues vs. external/downstream P1 Estimated Priority (P0 is highest, P4 is lowest)

Comments

@danijam
Copy link

danijam commented Mar 15, 2024

Describe the bug
We are trying to reconcile the data results from OpenCost for our AKS cluster. The results from our prometheus /api/v1/query?query=node_cpu_hourly_cost for the Azure VM SKU Standard_DS2_v2 give us a value of $0.058301/core/hour That's a two core machine so the total hourly cost for the VM instance is $0.116602/hour. When we download our Azure Billing Account/Billing Profile Pricing Sheet and lookup this VM SKU the hourly price is $0.1360/hour. Meaning OpenCost is using a hourly price that is off by $0.019398/hour for nodes in our cluster using Standard_DS2_v2 VMs.

We are a MCA Azure customer (Microsoft Customer Agreement) which uses standard pay-as-you-go rates with Offer Id ms-azr-0017g (https://azure.microsoft.com/en-gb/pricing/offers/ms-azr-0017g/)

I noticed that the logs from OpenCost is referring to MS-AZR-0003p (https://azure.microsoft.com/en-gb/pricing/offers/ms-azr-0003p/) as the durable offer id. That I believe refers to customers who contract with Azure under the general Microsoft Online Subscription Agreement . (https://azure.microsoft.com/en-gb/support/legal/subscription-agreement). This also using allegedly using standard PAYG rates.

I can't prove if the offer id difference is to blame, in theory I would not expect it to given they both use standard PAYG rates.

We are not a Enterprise Agreement Customer and so can't use the instructions here https://www.opencost.io/docs/configuration/azure#customer-specific-pricing

Would love some assistance to debug this further.

To Reproduce
Steps to reproduce the behavior:

  1. Create a AKS cluster (no specific configuration required)
  2. Install Prometheus (https://www.opencost.io/docs/installation/prometheus)
  3. Install OpenCost (https://www.opencost.io/docs/installation/helm)
  4. Query query=node_cpu_hourly_cost (https://www.opencost.io/docs/troubleshooting#verifying-pricing)
  5. From Azure Portal - Navigate to Cost Management + Billing
  6. Select Billing Account/Billing Scope where you AKS cluster is being billed
  7. (If you have Billing Profiles go to the correct Billing Profile
  8. From the Summary page select "Download Usage and Prices" from the "Shortcuts" box
  9. Download price sheet and locate VM price rate
    image

Expected behaviour
I can reconcile the node_cpu_hourly_cost value to the Azure price sheet for a given VM SKU/Region

Which version of OpenCost are you using?
1.109.0 (Chart version 1.31.0)

Additional context
AKS - k8s version 1.28.3

@mattray
Copy link
Collaborator

mattray commented Mar 21, 2024

I'm not familiar with the issue you're facing, but if @r2k1, @Sean-Holcomb or any of the other @opencost/opencost-maintainers are more familiar with Azure billing they might be able to weigh in.

@mattray mattray added opencost OpenCost issues vs. external/downstream P1 Estimated Priority (P0 is highest, P4 is lowest) kubecost Relevant to Kubecost's downstream project E2 Estimated level of Effort (1 is easiest, 4 is hardest) labels Mar 21, 2024
@danijam
Copy link
Author

danijam commented Mar 21, 2024

@mattray are you are at kubecon? Happy to come say hi 👋

@mattray
Copy link
Collaborator

mattray commented Mar 21, 2024

@danijam I am, happy to follow up in Slack or outside GitHub :) I'll be at the OpenCost kiosk Friday 12:30-2:30 in the Project Pavilion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2 Estimated level of Effort (1 is easiest, 4 is hardest) kubecost Relevant to Kubecost's downstream project needs-follow-up needs-triage opencost OpenCost issues vs. external/downstream P1 Estimated Priority (P0 is highest, P4 is lowest)
Projects
None yet
Development

No branches or pull requests

2 participants