I'm building an application on AWS that uses a lot of their services - S3, DynamoDB, Lambda, API Gateway, SQS, etc. I'm trying to figure out how I can track customer activity across my application. S3 is easy at a general level (I can see how much a user is storing based on the size of their directory within a given bucket) but I'm not sure how to monitor how much they're uploading/downloading. Same issue every other service, really. I was thinking something to do with Kinesis Streams, DynamoDB and CloudWatch should be in the right area, but I just can't put it together...
Does anybody else have experience doing this? Most crucially, I want to be able to attribute all my costs back to customers in some way so I can more accurately price my service. I know there are a lot of businesses out there doing it, so it's hardly a new problem! :)
Are you building some kind of multi-tenant application? What I do is creating a separate AWS account per customer.
See: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/consolidated-billing.html
That's actually a really good idea! I could integrate that into the customer onboarding flow. Thanks, I'll try that out!
I think you can give labels to services which you can then use to filter stats. But I never tried that
@patoncrispy Keep in mind that the amount of accounts that you can create is limited. If you expect to onboard lots of customers AWS-support can increase this limit.
See: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html
What are you using for Auth? Cognito? I've tried using aws pinpoint to track this stuff, but found it somewhat hard to use. At least in the front end.
Yeah I'm using Cognito. As it's so well integrated I thought it might help solve this problem. I thought Pinpoint was for tracking user engagement, no? I'm kinda looking for stuff to see what Lambda functions they ran, their usage in DynamoDB, etc. I think @stephan85's solution of creating an account per customer is probably a good way to go. I'll try that at least and go from there! :)