UNPKG

cdk-monitoring-constructs

Version:

[![NPM version](https://badge.fury.io/js/cdk-monitoring-constructs.svg)](https://badge.fury.io/js/cdk-monitoring-constructs) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.cdklabs/cdkmonitoringconstructs/badge.svg)](https://m

105 lines (104 loc) 5.71 kB
import { GraphWidget, HorizontalAnnotation, IWidget } from "aws-cdk-lib/aws-cloudwatch"; import { ElastiCacheServerlessMetricFactoryProps } from "./ElastiCacheServerlessMetricFactory"; import { BaseMonitoringProps, ElastiCacheAlarmFactory, LatencyAlarmFactory, LatencyThreshold, MaxThrottleRateThreshold, MetricWithAlarmSupport, MinHitRateThreshold, Monitoring, MonitoringScope } from "../../common"; import { MonitoringHeaderWidget } from "../../dashboard"; /** * Configuration options for monitoring ElastiCache Serverless clusters. * * Extends BaseMonitoringProps to include alarm configurations specific to * ElastiCache Serverless metrics such as latency, throttling, cache hit rates, * and item counts. */ export interface ElastiCacheServerlessMonitoringOptions extends BaseMonitoringProps { /** * Add alarm when the 99th percentile (TM99) latency for successful read requests exceeds a threshold. * * The key is a disambiguator (e.g., "Warning", "Critical") and the value defines the latency threshold. * * @default - no alarm */ readonly addTM99SuccessfulReadRequestLatencyAlarm?: Record<string, LatencyThreshold>; /** * Add alarm when the average latency for successful read requests exceeds a threshold. * * The key is a disambiguator (e.g., "Warning", "Critical") and the value defines the latency threshold. * * @default - no alarm */ readonly addAverageSuccessfulReadRequestLatencyAlarm?: Record<string, LatencyThreshold>; /** * Add alarm when the 99th percentile (TM99) latency for successful write requests exceeds a threshold. * * The key is a disambiguator (e.g., "Warning", "Critical") and the value defines the latency threshold. * * @default - no alarm */ readonly addTM99SuccessfulWriteRequestLatencyAlarm?: Record<string, LatencyThreshold>; /** * Add alarm when the average latency for successful write requests exceeds a threshold. * * The key is a disambiguator (e.g., "Warning", "Critical") and the value defines the latency threshold. * * @default - no alarm */ readonly addAverageSuccessfulWriteRequestLatencyAlarm?: Record<string, LatencyThreshold>; /** * Add alarm when the throttle rate (percentage of throttled commands) exceeds a threshold. * * The key is a disambiguator (e.g., "Warning", "Critical") and the value defines the usage threshold. * * @default - no alarm */ readonly addThrottleRateAlarm?: Record<string, MaxThrottleRateThreshold>; /** * Add alarm when the cache hit rate falls below a minimum threshold. * * The key is a disambiguator (e.g., "Warning", "Critical") and the value defines the minimum hit rate threshold. * * @default - no alarm */ readonly addHitRateAlarm?: Record<string, MinHitRateThreshold>; } export interface ElastiCacheServerlessMonitoringProps extends ElastiCacheServerlessMetricFactoryProps, ElastiCacheServerlessMonitoringOptions { } export declare class ElastiCacheServerlessMonitoring extends Monitoring { readonly title: string; readonly metricMaxItemCount: MetricWithAlarmSupport; readonly metricEvictions: MetricWithAlarmSupport; readonly metricAverageCacheSize: MetricWithAlarmSupport; readonly metricMaxElastiCacheProcessingUnits: MetricWithAlarmSupport; readonly metricAverageConnections: MetricWithAlarmSupport; readonly metricNetworkBytesIn: MetricWithAlarmSupport; readonly metricNetworkBytesOut: MetricWithAlarmSupport; readonly metricTM99SuccessfulReadRequestLatency: MetricWithAlarmSupport; readonly metricAverageSuccessfulReadRequestLatency: MetricWithAlarmSupport; readonly metricTM99SuccessfulWriteRequestLatency: MetricWithAlarmSupport; readonly metricAverageSuccessfulWriteRequestLatency: MetricWithAlarmSupport; readonly metricTotalThrottledCmds: MetricWithAlarmSupport; readonly metricTotalCmds: MetricWithAlarmSupport; readonly metricThrottleRate: MetricWithAlarmSupport; readonly metricAverageCacheHitRate: MetricWithAlarmSupport; readonly metricCacheHits: MetricWithAlarmSupport; readonly metricCacheMisses: MetricWithAlarmSupport; readonly elastiCacheAlarmFactory: ElastiCacheAlarmFactory; readonly latencyAlarmFactory: LatencyAlarmFactory; readonly tm99SuccessfulReadRequestLatencyAlarmAnnotations: HorizontalAnnotation[]; readonly averageSuccessfulReadRequestLatencyAlarmAnnotations: HorizontalAnnotation[]; readonly tm99SuccessfulWriteRequestLatencyAlarmAnnotations: HorizontalAnnotation[]; readonly averageSuccessfulWriteRequestLatencyAlarmAnnotations: HorizontalAnnotation[]; readonly throttleRateAlarmAnnotations: HorizontalAnnotation[]; readonly hitRateAlarmAnnotations: HorizontalAnnotation[]; constructor(scope: MonitoringScope, props: ElastiCacheServerlessMonitoringProps); summaryWidgets(): IWidget[]; widgets(): IWidget[]; createTitleWidget(): MonitoringHeaderWidget; createSuccessfulReadLatencyWidget(width: number, height: number): GraphWidget; createSuccessfulWriteLatencyWidget(width: number, height: number): GraphWidget; createCacheSizeWidget(width: number, height: number): GraphWidget; createCacheHitAndMissWidget(width: number, height: number): GraphWidget; createCacheCmdsWidget(width: number, height: number): GraphWidget; createNetworkWidget(width: number, height: number): GraphWidget; createProcessingUnitsWidget(width: number, height: number): GraphWidget; createItemCountWidget(width: number, height: number): GraphWidget; createConnectionsWidget(width: number, height: number): GraphWidget; }