-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Azure Billing] Update forecast api metrics interval #36142
Conversation
This pull request doesn't have a |
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
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.
The Forecast API returns two kinds of data in the same response:
- actual data, the consolidated past costs.
- forecast data, the forecast of future costs.
By changing the interval to -1 day and +30 days, we are getting the forecast data but missing the actual data. This happens because actual data are past costs that require some time to consolidate.
Here's the actual response using the PR code:
Here's a quick test with -2 days instead of -1 days, so we give actual data to consolidate:
We also need to update the |
…o forecast_metrics_fix
…o forecast_metrics_fix
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.
I tested this change, and it looks good.
On each collection, we're now getting:
- one day of actual costs
- 30 days of forecast costs
So we expect the integration to accumulate actual costs over time and have a 30 days outlook of forecasted costs.
Thanks @zmoog ! |
* Update forecast API metrics interval
What does this PR do?
Fixes #35633
Why is it important?
The proposed change fetches the forecast data for the next 30 days from the current day(-2). As of today, the forecast metrics is fetched from the beginning of the month to the end of the month. Considering the fact that this API returns the actual data to consolidate the cost we are adjusting the start date to current day - 2 days.
How to test this PR locally
Related issues
Screenshots