UNPKG

cdk-monitoring-constructs

Version:

[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/cdklabs/cdk-monitoring-constructs) [![NPM version](https://badge.fury.io/js/cdk-monitoring-constructs.svg)](https://badge

65 lines (64 loc) 4.25 kB
import { GraphWidget, HorizontalAnnotation, IWidget } from "aws-cdk-lib/aws-cloudwatch"; import { AlarmFactory, BaseMonitoringProps, ErrorAlarmFactory, ErrorCountThreshold, ErrorRateThreshold, HighTpsThreshold, LatencyAlarmFactory, LatencyThreshold, LatencyType, LowTpsThreshold, MetricWithAlarmSupport, Monitoring, MonitoringScope, TpsAlarmFactory } from "../../common"; import { MonitoringHeaderWidget } from "../../dashboard"; import { ApiGatewayMetricFactoryProps } from "./ApiGatewayMetricFactory"; export interface ApiGatewayMonitoringOptions extends BaseMonitoringProps { readonly add4XXErrorCountAlarm?: Record<string, ErrorCountThreshold>; readonly add4XXErrorRateAlarm?: Record<string, ErrorRateThreshold>; readonly add5XXFaultCountAlarm?: Record<string, ErrorCountThreshold>; readonly add5XXFaultRateAlarm?: Record<string, ErrorRateThreshold>; readonly addLatencyP50Alarm?: Record<string, LatencyThreshold>; readonly addLatencyP70Alarm?: Record<string, LatencyThreshold>; readonly addLatencyP90Alarm?: Record<string, LatencyThreshold>; readonly addLatencyP95Alarm?: Record<string, LatencyThreshold>; readonly addLatencyP99Alarm?: Record<string, LatencyThreshold>; readonly addLatencyP999Alarm?: Record<string, LatencyThreshold>; readonly addLatencyP9999Alarm?: Record<string, LatencyThreshold>; readonly addLatencyP100Alarm?: Record<string, LatencyThreshold>; readonly addLatencyTM50Alarm?: Record<string, LatencyThreshold>; readonly addLatencyTM70Alarm?: Record<string, LatencyThreshold>; readonly addLatencyTM90Alarm?: Record<string, LatencyThreshold>; readonly addLatencyTM95Alarm?: Record<string, LatencyThreshold>; readonly addLatencyTM99Alarm?: Record<string, LatencyThreshold>; readonly addLatencyTM999Alarm?: Record<string, LatencyThreshold>; readonly addLatencyTM9999Alarm?: Record<string, LatencyThreshold>; readonly addLatencyAverageAlarm?: Record<string, LatencyThreshold>; readonly addLowTpsAlarm?: Record<string, LowTpsThreshold>; readonly addHighTpsAlarm?: Record<string, HighTpsThreshold>; /** * You can specify what latency types you want to be rendered in the dashboards. * Note: any latency type with an alarm will be also added automatically. * If the list is undefined, default values will be shown. * If the list is empty, only the latency types with an alarm will be shown (if any). * @default - p50, p90, p99 (@see DefaultLatencyTypesToRender) */ readonly latencyTypesToRender?: LatencyType[]; } export interface ApiGatewayMonitoringProps extends ApiGatewayMetricFactoryProps, ApiGatewayMonitoringOptions { } export declare class ApiGatewayMonitoring extends Monitoring { protected readonly title: string; protected readonly alarmFactory: AlarmFactory; protected readonly errorAlarmFactory: ErrorAlarmFactory; protected readonly tpsAlarmFactory: TpsAlarmFactory; protected readonly latencyAlarmFactory: LatencyAlarmFactory; protected readonly tpsAnnotations: HorizontalAnnotation[]; protected readonly latencyAnnotations: HorizontalAnnotation[]; protected readonly errorCountAnnotations: HorizontalAnnotation[]; protected readonly errorRateAnnotations: HorizontalAnnotation[]; protected readonly tpsMetric: MetricWithAlarmSupport; protected readonly error4XXCountMetric: MetricWithAlarmSupport; protected readonly error4XXRateMetric: MetricWithAlarmSupport; protected readonly fault5XXCountMetric: MetricWithAlarmSupport; protected readonly fault5XXRateMetric: MetricWithAlarmSupport; protected readonly latencyMetrics: Record<string, MetricWithAlarmSupport>; protected readonly latencyTypesToRender: string[]; constructor(scope: MonitoringScope, props: ApiGatewayMonitoringProps); summaryWidgets(): IWidget[]; widgets(): IWidget[]; protected createTitleWidget(): MonitoringHeaderWidget; protected createTpsWidget(width: number, height: number): GraphWidget; protected createLatencyWidget(width: number, height: number): GraphWidget; protected createErrorCountWidget(width: number, height: number): GraphWidget; protected createErrorRateWidget(width: number, height: number): GraphWidget; }