I try to work with custom CloudWatch Metrics. Pushing metrics thorugh aws-go-sdk-v2 works fine but I have an issue working with the metrics in the web UI. My workload only runs every once every 24h but in the web ui I can only query for metrics in the last 3h hours it seems.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-limits.html also says Currently, you can query only the most recent three hours of data.
Do I have to post process the data somehow to get a historical view of the data? Since I can set the graph to 1w time window I suspect there must be a way to achieve this. Any ideas what I am missing?
2
Answers
CloudWatch retains metric data as follows:
hours. These data points are high-resolution custom metrics.
days
Ref: https://aws.amazon.com/cloudwatch/faqs/#:~:text=CloudWatch%20retains%20metric%20data%20as,are%20available%20for%2015%20days
This means your metrics are still available, for 15 months to be exactly, which you can check out in the Cloudwatch console, section
Metrics > All Metrics
. This will show you a graph of all the data collected, you need to adjust the time interval and period of your metrics.If you want to query your metrics, you can only do it with 3 hour more recent data (even if your metrics are still in Cloudwatch), you cannot use metric insights on older data.
If you need to retrieve your metrics using CloudWatch Metrics Insights, please note that currently we only support receiving no more than 3 hours of your data.
Since you need to search metric names and retrieve data for an interval longer than 3 hours, I would recommend using the regular search syntax, or plot your metrics individually.