Regarding AWS Marketplace Metering service for Containers

260 Views Asked by At

I need to launch a container product and I have query regarding the aws metering services. I was following this doc for container metering services https://docs.aws.amazon.com/marketplace/latest/userguide/entitlement-and-metering-for-paid-products.html. Coming to my queries which are as below.

1) Do I need to add any code to my container to call the APIs for metering?

2) What if I don't want to add this API code in my main container can I create a separate container just for metering API calls?

3) How the metering will work? any simple explanation will be appreciated.

1

There are 1 best solutions below

0
On

To measure the product usage so that you can charge customers, you need to write the code that invokes/calls metering APIs.

Now, where to integrate that code? You can either add it to your primary container (recommended as it is simple) OR you can create a separate container for it (use a sidecar pattern).

How does metering work? There are two APIs, from which you need to use one API based on your requirement.

  1. RegisterUsage: It's most simple, and used when you have pod/hour type of billing. Now, from AWS: "Metering for software use is automatically handled by the AWS Marketplace Metering Control Plane -- your software is not required to perform any metering specific actions, other than call RegisterUsage once for metering of software use to commence."
  2. MeterUsage: It is used for custom metering, where you define which dimensions(units) you want to track for usage, you've to write a separate logic that measures usage, and eventually you've to invoke API. For example, if you want to charge a customer based on vCPU/pod/hour model (UsageDimension = vCPU), you need to programmatically calculate the vCPU of all pods of your product (which is yours UsageQuantity), and then call API.