Skip to content

Will I be charged for Cloudwatch to monitor storage on each path in the same EC2?

0

I used the AWS dashboard to enable "disk_used_percent" and "mem_used_percent" monitoring on my 2 EC2. From what I understand, in my configuration I am adding 2 metrics to each EC2, a total of 4 additional metrics, so I should be in the free tier but I am not.

Enter image description here

I think the problem is because "disk_used_percent" brings isolated metrics for each path, but I was unable to make it monitor only the root path ("/"). What is the solution so that I can stay in the free tier? After all, I should have up to 10 additional free metrics.

Enter image description here

asked 9 months ago75 views
1 Answer
0

You're correct in your understanding that you've added two custom metrics (disk_used_percent and mem_used_percent) to each of your two EC2 instances. However, the reason you're seeing more metrics than expected is due to how the disk_used_percent metric works.

The disk_used_percent metric is collected for each mount point or filesystem on your EC2 instance. This means that if your EC2 instance has multiple partitions or attached volumes, you'll get a separate metric for each of these. This is why you're seeing multiple entries for disk_used_percent in your CloudWatch metrics.

To stay within the free tier (which allows up to 10 custom metrics), you have a few options:

  1. Limit disk monitoring to specific mount points: In your CloudWatch agent configuration, you can specify which mount points to monitor. For example, you could monitor only the root partition ("/") by adding a "resources" section to your disk measurement configuration:

    "disk": {
      "resources": ["/"],
      "measurement": ["disk_used_percent"],
      "metrics_collection_interval": 60
    }
  2. Use a single aggregated disk metric: Instead of monitoring each partition separately, you could use a single metric that represents the overall disk usage of the instance. This would require some custom scripting or using a different metric collection method.

  3. Reduce the number of instances or metrics you're monitoring: If you need to monitor all partitions, you might need to be selective about which instances or metrics you monitor to stay within the free tier.

Remember that CloudWatch billing is prorated hourly, so you won't immediately see the full impact of your metrics in the billing dashboard. It may take up to 24 hours for the usage to be fully reflected.

Also, note that while the first 10 custom metrics are free, there may still be charges for API calls to publish these metrics. The CloudWatch agent typically makes one PutMetricData API call per minute for each EC2 instance, which can result in charges if you exceed the free tier limits for API calls.
Sources
CloudWatch solution: Amazon EC2 health - Amazon CloudWatch
¿How does the billing of Cloudwatch Custom Metrics work? | AWS re:Post
Amazon CloudWatch Pricing – Amazon Web Services (AWS)

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.