Ir para o conteúdo

How do I calculate throughput and set a CloudWatch alarm for Transit Gateway?

3 minuto de leitura
0

I have an AWS Transit Gateway attachment. I want to use Amazon CloudWatch metrics to calculate throughput, and set up a throughput-based notification.

Short description

Use CloudWatch metrics to calculate throughput for a Transit Gateway attachment. To create an alert for when throughput exceeds your specified values, create a CloudWatch alarm with an Amazon Simple Notification Service (Amazon SNS) notification.

Important: Throughput calculation is approximate and doesn't provide exact up-to-the-moment bandwidth usage. A CloudWatch metrics alarm is effective for connections that exceed throughput for a duration of 15 minutes or more.

Resolution

To calculate throughput on a Transit Gateway attachment complete the following steps:

  1. Open the CloudWatch console, and then choose the AWS Region that's associated with your transit gateway.
  2. In the navigation pane, choose Metrics. Then, choose All metrics.
  3. Under All Metrics, choose TransitGateway. Then, choose Per-TransitGatewayAttachmentMetrics.
  4. Select the BytesIn and BytesOut metrics for the Transit Gateway attachment that you want to measure.
  5. Choose the Graphed metrics tab, and then set the following parameters:
    Statistics: SUM
    Period: 5 minutes
  6. Choose Add Math.
  7. From the dropdown list, choose Start with an empty expression. To monitor throughput for each direction separately, create two math expressions.
    For Ingress throughput, in the math expression box enter m1*8/300.
    For Egress throughput, in the math expression box enter m2*8/300.
  8. This formula converts bytes per second (Bps) to bits per second (bps). The variables represent the following values:
    m1 = BytesIn
    m2 = BytesOut
  9. Choose Apply.
  10. In the graphed metrics section, you see the expression that you added and the metrics in the expression. To see the representation in the graph section, select only the expression that you added: m1*8/300 and m2*8/300. The output is in bits per second.
    Note: Clear m1 and m2 so that you select only the math expression.
  11. Create a CloudWatch alarm based on a metric math expression. When you create the alarm, set the following values:
    For Select metric, enter one of the expressions that you created in step 7. Create two separate alarms, one for ingress and one for egress.
    In the Conditions section, set the throughput value that you want to monitor as a condition. For example, to be notified when throughput reaches 100 Mbps, enter Greater/Equal(>=) 100,000,000.
    In the Additional configuration section, set Datapoints to alarm to 3 out of 3.
  12. (Optional) Set up Amazon SNS notifications for the CloudWatch alarm.

Related information

Transit Gateway metrics

1 Comentário

This article was reviewed and updated on 2026-09-11.

ESPECIALISTA

respondeu há 2 dias

Conteúdo relevante