Skip to content

Instantly share code, notes, and snippets.

@mgjam
Created October 16, 2020 16:35
Show Gist options
  • Save mgjam/2cd456ceeefadf3d1a2770de2a0a4629 to your computer and use it in GitHub Desktop.
Save mgjam/2cd456ceeefadf3d1a2770de2a0a4629 to your computer and use it in GitHub Desktop.
import { GraphWidget, IWidget, Metric } from "@aws-cdk/aws-cloudwatch";
import { Construct, Duration } from "@aws-cdk/core";
const latencyWidget = new GraphWidget({
width: 24,
title: 'API Latency',
left: [new Metric({
metricName: 'Latency',
namespace: 'AWS/ApiGateway',
dimensions: {'ApiName': 'apiName'},
statistic: 'avg',
label: 'AVG',
period: Duration.hours(3)
}), new Metric({
metricName: 'Latency',
namespace: 'AWS/ApiGateway',
dimensions: {'ApiName': 'apiName'},
statistic: 'max',
label: 'MAX',
period: Duration.hours(3)
})]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment