Score:1

Proof that aws cloudwatch get-metric-statistics works

cr flag

I am learning to use the aws cloudwatch get-metric-statistics subcommand in the AWS command line tool. To prove to myself that I am using the tool correctly, I would like a simple example command that should always return some data. Or, at least, that should always return some datapoints provided one has a typical minimum of deployed AWS resources.

So far, every command I have run returns zero datapoints. For example:

aws cloudwatch get-metric-statistics --metric-name CPUUtilization --start-time $(gdate -u -d '-1 hour' +%FT%T) --end-time $(gdate -u +%FT%T) --period 3600 --namespace AWS/EC2 --statistics Maximum

I was hoping that this would return at least some CPU utilization data from my EC2 instances, as a demonstration that I could get any kind of data. But I don't:

{
    "Label": "CPUUtilization",
    "Datapoints": []
}

Can anyone suggest a command that will show me something? Anything? Then, if it dosen't work, I'll at least know I'm misconfigured somehow.

Score:0
in flag

Check if it is a problem with the timestamp format:

aws cloudwatch get-metric-statistics --metric-name CPUUtilization --start-time $(gdate -u -d '-1 hour' '+%Y-%m-%dT%H:%M:%SZ') --end-time $(gdate '+%Y-%m-%dT%H:%M:%SZ') --period 3600 --namespace AWS/EC2 --statistics Maximum

Also make sure that the region is set correct

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.