HACKER Q&A
📣 Mojmalik

How do you set up a system to track customer's usage in AWS?


Hello,

I have created a tool on top of AWS Textract(a OCR tool). I am trying to add a paid tier account but I am not sure how to set up tracking of usage or what the term for this is called to begin to google resources for it. Googling tracking usage in aws only brings up personal tracking of cloud costs.

Thank you!


  👤 mindcrime Accepted Answer ✓
Hrrmm... for "object" based AWS stuff, it's fairly easy: you add a tag[1] to the resource (an EC2 instance for example) and those tags are exposed in the billing reports, so you can correlate them back to your customer accounts. I haven't used any of the "pure api" based Amazon services, so not sure if there's an exact analogue of that or not. I see that there's a jobTag[2] field you can add to the request for Textract calls, and that that can in turn be sent to an SNS topic.

If that same field makes its way into the billing report, this would be fairly easy. If not, I think you might just have to track how many calls are made on behalf of a given customer (your customer) and then write code to calculate how much to charge your customer based on the published pricing information[3] for the service. You could do the tracking using that jobTag thing and SNS topic, or you could probably track it on your end if there is code you control that is actually initiating the Textract request. One tricky part here will be keeping track of price changes and when they happen, so you can reflect that in your calculations.

Maybe there's a cleaner way to do it. Ideally there'd be a way to pass something in the request that flows all the way through to the billing report, but I am not sure if that "thing" exists for these services or not.

[1]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2...

[2]: https://sdk.amazonaws.com/java/api/latest/software/amazon/aw...()

[3]: https://aws.amazon.com/textract/pricing


👤 necovek
There used to be an AWS marketplace where you could create your own "app" on top of AWS.

I remember that you could have an add-on for EC2 instances where Amazon would call back your service with EC2 usage data.

The biggest issue was that you had to pass spreadsheets around to get set up, but that was 6+ years ago when Amazon just introduced the feature.


👤 xq3000
You could try posting this question on the official AWS forum https://repost.aws/