Currently, the cost exports that can be generated in the Cost Management section in the portal, have a daily granularity. However, savings plan commitments are made on an hourly basis and as such I cannot calculate the utilization % and coverage% per hour from the exports. It can only be done on the data this is pre-aggregated on the daily basis, yielding inaccurate percentages (especially when there is no good spread in compute spend over the different hours in a day...).
So my question is, where can I get cost & usage details with hour granularity, in an automated way (API query / scheduled export) so I can I calculate the CORRECT utilization & coverage percentages?
The following (purely fictive) example shows the problem. Assume, just for the sake of this example, that a day contains 5 hours and that there is a single SP commitment of USD 80 per hour.
Assume these are the usage / cost details:
hour 1: used $320 ($80 within SP that would have cost $120 ondemand, $240 outside SP, $0 unused)
hour 2: used $1 ($1 within SP that would have cost $1.5 ondemand,$0 outside SP, $79 unused)
hour 3: used $1 ($1 within SP that would have cost $1.5 ondemand,$0 outside SP, $79 unused):
hour 4: used $0 ($0 within SP that would have cost $0 ondemand,$0 outside SP, $80 unused):
hour 5: used $10 ($10 within SP that would have cost $15 ondemand,$0 outside SP, $70 unused)
When calculating utilization and coverage, it would yield the following stats:
hr1: coverage $120/ ($120 + $240) = 33%, utilization = ($80-$0)/$80 = 100%
hr2: coverage $1.5/($1.5+$0) = 100%, utilization = ($80-$79)/$80 = 1.25%
hr3: coverage 100%, utilization 1.25%
hr4: coverage 100%, utilization 0%
hr5: coverage 100%, utilization 1.25%
However, as the cost exports have only data aggregated on the day, the following stats are calculated for the day:
utilization = ($400) - ($0+$79+$79+$80+$70) / $400 = (400-308)/400 = 23%
coverage = 120+1.5+1.5+0+15 / (138 + 240) = 138/378 = 36.5%
These are, as one can see, not very informative numbers. When the average over all 5 hours in the day are calculated, especially the coverage % is very different:
utilization 20.75%
coverage 86.6%
So my question is, where can I get cost & usage details with hour granularity, in an automated way (API query / scheduled export) so I can I calculate the CORRECT utilization & coverage percentages per hour?