Cloudwatch graphmetric math function for particular time range


I need to calculate the over-all uptime percentage of my server using route 53 Healthcheckpercentagehealthy metric. I can able to generate dashboard for entire month which means 30 days and 24/7. But I need to generate dashboard for entire month but only for 8Am to 8Pm.

Is that possible? If it's possible please let me know the math function which will help me.

1 Risposta

The CloudWatch metric math enables you to query multiple CloudWatch metrics and use math expressions to create new time series based on these metrics. However, these expressions do not support a feature to limit the time range or set up a window within a day such as from 8am to 8pm.

If you need this level of granular filtering, you might have to export your metrics to another service that provides more advanced analysis capabilities or use an AWS SDK or CLI to programmatically retrieve the metric data and then filter and analyze it in your own application or script.

For example

import boto3

client = boto3.client('cloudwatch')

response = client.get_metric_data(
            'Id': 'm1',
            'MetricStat': {
                'Metric': {
                    'Namespace': 'AWS/Route53',
                    'MetricName': 'HealthCheckPercentageHealthy',
                    'Dimensions': [
                            'Name': 'HealthCheckId',
                            'Value': 'your_healthcheck_id'
                'Period': 300,
                'Stat': 'Average',
            'ReturnData': True,
profile picture
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande