Search code examples
amazon-cloudwatchamazon-athena

Athena CloudWatch Metrics Connector only returns data from the past trailing 15 days


I have set up an Athena CloudWatch Metrics connector: https://docs.aws.amazon.com/athena/latest/ug/connectors-cwmetrics.html, but when I query the metric_samples table from the Athena UI for data from the past two months, the earliest data point that gets returned is from 15 days ago.

I see from the CloudWatch UI that data does exist from the past two months.

I also know that CloudWatch retains the metric data based on the period of the datapoint: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html, but if I try to query for data points with periods > 60 seconds, I get no results.

How can I query for CloudWatch metrics data points older than 15 days through Athena?


Solution

  • Figured out that I needed to specify the period in my query as period = 300 instead of period != 60 or period > 60.

    https://community.amazonquicksight.com/t/athena-cloudwatch-metrics-connector-only-returns-data-from-the-past-trailing-15-days/17955