0
votes

I'm trying to identify the initial creation date of a metric on CloudWatch using the AWS CLI but don't see any way of doing so in the documentation. I can kind of identify the start date if there is a large block of missing data but that doesn't work for metrics that have large gaps in data.

1
Are you referring to the existence of the 'Metric' in CloudWatch, or of individual 'metrics' (numbers) sent through to CloudWatch? Can't you just keep going back in time, asking for metrics, to see when the first metric data is available?John Rotenstein
You could also inspect CloudTrial trial for the create metric API calls.Marcin
@JohnRotenstein I could do that but with over 100 metrics and counting I'd expend a ton of api calls just to identify a start date. Essentially, I'm trying to get enough data to set an accurate threshold alarm which requires about a month's worth of data.Chris Winkler

1 Answers

0
votes

CloudWatch metrics are "created" with the first PutMetricData call that includes the metric. I use quotes around created, because the metric doesn't have an independent existence, it's simply an entry in the time-series database. If there's a gap in time with no entries, the metric effectively does not exist for that gap.

Another caveat to CloudWatch metrics is that they only have a lifetime of 455 days, and individual metric values are aggregated as they age (see specifics at link).

All of which begs the question: what's the real problem that you're trying to solve.