Empty DataPoints when getting s3 metrics from cloudwatch
See original GitHub issueHi, when using boto3 to get s3 metrics i get empty metrics, I get the metrics via list_metrics(), I can see them on CloudWatch AWS Web Console, I’ve tried different time spans (from 1minute to 1 Day) - Always return empty.
Changed the units, the Statistics. bah.
cw = boto3.client('cloudwatch')
cw.get_metric_statistics(Namespace='AWS/S3',MetricName='BucketSizeBytes', StartTime=datetime.utcnow() - timedelta(days=1), EndTime=datetime.utcnow(), Period=86400, Statistics=['Sum'],Unit='Bytes',Dimensions=[{'Name':'BucketName', 'Value':'backup-bucket'}])
OUTPUT:
{u'Datapoints': [],
u'Label': 'BucketSizeBytes',
'ResponseMetadata': {'HTTPStatusCode': 200,
'RequestId': 'a5c04a0e-4579-11e5-ab73-add86b87b8d9'}}
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Why isn't my CloudWatch GetMetricStatistics API call returning ...
My Amazon CloudWatch "GetMetricStatistics" API call isn't returning any data points. However, the data points are available on the ...
Read more >Empty datapoints received while retrieving AWS S3 Request ...
From AWS Console, I'm able to see datapoints for the same timestamp. I tried increasing the timeframe but it still gibes the same...
Read more >No data appears: AWS CloudWatch metric streams
Check the Metric Stream metrics under AWS/CloudWatch/MetricStreams namespace. You will see a count of metric updates and errors per Metric Streams. This ...
Read more >Why is GetMetricStatistics not returning any data points?
... AWS Knowledge Center: https://aws.amazon.com/premiumsupport/knowledge-center/ cloudwatch -getmetricstatistics-dataTruptesh, an AWS Clo...
Read more >Getting metrics from Amazon CloudWatch with Amazon SDK ...
List Amazon CloudWatch metrics, retrieve alarms for metrics, and get metric statistics using the Amazon SDK for PHP Version 3.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah! Got it to work by trying bigger time window. I had a timespan of 1 day which was working but it stopped and I had to increase it to 2 days.
So here is what I did to get it to work:
The important points are that you need to take from this is: the second
StorageType
dimension and the start date needs to be more than one day from the current time. I could not find too much documentation in the CloudWatch docs about it. However based on the console, you need thatStorageType
as well to correctly view the data points. Also, the data point, for me, is delivered daily at 12 AM so my guess the range of a day you specified was too small. However, I was not able to find the official minimum span that you must specify.Let me know if you have any more questions.