rubyamazon-web-servicesaws-ebs

CloudWatch API returning strange results


I have some strange results while trying to query the 'Volume Write Bytes' metric using get_metric_statistics for some of my EBS Volumes. I was wondering if someone can help me understand the response I'm getting from AWS, for the purpose of this post please take into account that the real volume id has been changed to "vol-1234".

{"Cloudwatch Args"=>{:namespace=>"AWS/EBS", :metric_name=>"VolumeWriteBytes", :dimensions=>[{:name=>"VolumeId", :value=>"vol-1234"}], :start_time=>2020-01-06 12:41:58 UTC, :end_time=>2020-01-06 15:41:
        58 UTC, :period=>300, :statistics=>["Average", "Minimum", "Maximum"]}, :account=>11, :region=>"us-east-1"}

HTTP POST (152.32ms) https://monitoring.us-east-1.amazonaws.com:443/
  Response status Net::HTTPOK (200)
  Response body <impossible to log>
=> [#<struct Aws::CloudWatch::Types::Datapoint timestamp=2020-01-06 13:56:00 UTC, sample_count=nil, average=4767.288888888889, sum=nil, minimum=0.0, maximum=0.0, unit="Bytes", extended_statistics={}>,
 #<struct Aws::CloudWatch::Types::Datapoint timestamp=2020-01-06 13:21:00 UTC, sample_count=nil, average=5512.661654135339, sum=nil, minimum=0.0, maximum=0.0, unit="Bytes", extended_statistics={}>,
 #<struct Aws::CloudWatch::Types::Datapoint timestamp=2020-01-06 15:06:00 UTC, sample_count=nil, average=5371.133079847908, sum=nil, minimum=0.0, maximum=0.0, unit="Bytes", extended_statistics={}>,
...

Can someone explain why the Average value seems to be around 4-5k, while the Maximum and Minimum values are 0.0 ? This seems to happen on multiple volumes and it's not an isolated case.


Solution

  • According to AWS :

    " Volume Write Bytes metric ---> Provides information on the write operations in a specified period of time. The Sum statistic reports the total number of bytes transferred during the period. The Average statistic reports the average size of each write operation during the period, except on volumes attached to a Nitro-based instance, where the average represents the average over the specified period. The SampleCount statistic reports the total number of write operations during the period, except on volumes attached to a Nitro-based instance, where the sample count represents the number of data points used in the statistical calculation. For Xen instances, data is reported only when there is write activity on the volume. The Minimum and Maximum statistics on this metric are supported only by volumes attached to Nitro-based instances."

    In conclusion we can rule out the theory of this being something unusual.