Is there a clear way to calculate starting uptime metrics from AWS ELB?
I need to start running uptime calculations. I'd like to start by just using AWS services for monitoring the uptime and then grow from there as I determine what I'd like that to mean.
I have the service behind an ELB as a target group. I trust the instance health check to indicate service uptime. I'd like to use the metrics on the AWS ELB as received by AWS CloudWatch to calculate the uptime over 30 days. If the
HealthyHostCount metric is 0 for 10 seconds, that's 10 seconds of downtime. Otherwise, we have uptime. Then I'd like to have a percentage of time up over a period (30 days) to the hundredth of a percent.
I've been playing with CloudWatch metrics to try to figure this out and finding that I can do math and have been getting results that seem in the right neighborhood, but I'm not confident that I'm properly thinking about the statistic period and the graph period. I'm also wondering if I should be using the PR statistic instead of doing my own math.
Here's what I have right now.
I'm grabbing the ELB's
HealthyHostCount as m1 and
UnhealthyHostCount as m2. Both are summed up for 30 days. Then I have an expression
100*(m1/m1+m2) to calculate percent up counts over the total counts taken for that 30 days. I have the chart set to a relative 30 days period.
The problem is that this calculation, as soon as I have some value greater than 0 in m2, seems to result in numbers in the thousands or millions instead of reducing the percent down from 100.
How would you calculate service percent uptime from AWS ELB metrics?