Bibit Apel Anna Super Murah Berkualitas Kudus

bibit apel anna super murah berkualitas Apel Anna merupakan salah satu jenis buah apel yang sampai saat ini menjadi primadona di Kota Batu. Jika matang bewarna merah rata, menjadikan buah ini sering…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Tracking DynamoDB Storage History with CloudWatch

However, there is one metric which many customers care about and is not currently tracked by DynamoDB on CloudWatch, that is your table size history. This blog post shares a simple process on how to track your tables size over time, which can be easily adapted to track several other metrics such as number of items stored over time.

TableSizeBytes: The total size of the specified table, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value. For this reason, we will update our CloudWatch metric every six hours.

Then for our EventBridge target, we will use a Lambda function.

Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your function only when needed and scales automatically, from a few requests per day to thousands per second. You pay only for the compute time that you consume — there is no charge when your code is not running.

Lambda will be invoked by our EventBridge trigger and the code within our Lambda will do a few simple things:

1. Call DynamoDB ListTables to retrieve all the tables within the region
2. Call DynamoDB DescribeTable for each table returned in the list request and retrieve the TableSizeBytes we previously mentioned.
3. Write our metric to CloudWatch using PutMetricData

For our Lambda function we will be using a Python runtime and Boto3 code.

Final Implementation

Fig 1.0 Resources used

Once we have all of the tables names and sizes, we then push those metrics to CloudWatch:

Below is a Sample image of how the metrics look on the CloudWatch Web Console. My tables had received no traffic on the day the image was taken, thus the straight lines.

Metrics should be set up like below when viewing, Statistic=Average and Period=6 hours:

If you would like to try this out in your own account, feel free to use the below CDK project which will create the resources for you. The install instructions are included in the README.

Please ensure you test any code which you run in your account before running in production.

Add a comment

Related posts:

So apakah TDEE itu?

Ini adalah tulisan artikel pertama gue di medium.com, so kali ini fokus gue selain bikin konten di instagram (lu bisa follow gue di IG akhmadifitness26 ), so kali ini gue akan membahas 1 hal basic…