4 ms·
We've got a last-ditch alert set when we spend more than $X in a day. But the way you have to do this is baroque and it is a bit unreliable. We set a metric on
by ajb 7y ago
We've got a last-ditch alert set when we spend more than $X in a day. But the way you have to do this is baroque and it is a bit unreliable. We set a metric on
Max(EstimatedCharges, over 1 day) - Min(EstimateCharges, over 1 day).
Unfortunately EstimatedCharges only updates once a day and sometimes the Max udpates before the Min, triggering a false alarm. Obviously we could make it more reliable by using a 48 hour period, but then we'd only find out if something went haywire when it had been going for 2 days.
Really, how much would it cost them to run the cron job for EstimateCharges once an hour? Even less would be good (you can spend a lot on AWS in an hour).
It also stops working if you have a credit (until it runs out) so good luck if something goes wrong during that period.
We even asked a consultant (recommended by Amazon) if there was a more fine grained method, and they thought the only way would be using a third party service which ingests all the events and does its own estimate. This is nuts! If your charging is as fine grained as AWS is, so should your reporting be.
- herostratus101 7y agoWondering if this would be a good Lambda application. Assuming boto3 allows it, you could have a Lambda function poll for this up to every minute. It actually might be a trivial function to write.
- haimez 7y agoWonder how much that lambda will cost you if it goes into an infinite loop
- herostratus101 7y agoWhy would it even involve a loop? And even your lambda function were: while True: pass Lambda functions time out after a period of time that you specify (limited to 15m max).
- ajb 7y agoThe problem is, the metric only changes value once per day. I don't think reading it in a lambda would trigger it to update faster (although I suppose it's worth trying).