Interface AlarmProps
- All Superinterfaces:
CreateAlarmOptions
,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AlarmProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-22T02:23:58.456Z")
@Stability(Stable)
public interface AlarmProps
extends software.amazon.jsii.JsiiSerializable, CreateAlarmOptions
Properties for Alarms.
Example:
LogGroup logGroup; MetricFilter mf = MetricFilter.Builder.create(this, "MetricFilter") .logGroup(logGroup) .metricNamespace("MyApp") .metricName("Latency") .filterPattern(FilterPattern.exists("$.latency")) .metricValue("$.latency") .dimensions(Map.of( "ErrorCode", "$.errorCode")) .unit(Unit.MILLISECONDS) .build(); //expose a metric from the metric filter Metric metric = mf.metric(); //you can use the metric to create a new alarm //you can use the metric to create a new alarm Alarm.Builder.create(this, "alarm from metric filter") .metric(metric) .threshold(100) .evaluationPeriods(2) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forAlarmProps
static final class
An implementation forAlarmProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic AlarmProps.Builder
builder()
The metric to add the alarm on.Methods inherited from interface software.amazon.awscdk.services.cloudwatch.CreateAlarmOptions
getActionsEnabled, getAlarmDescription, getAlarmName, getComparisonOperator, getDatapointsToAlarm, getEvaluateLowSampleCountPercentile, getEvaluationPeriods, getThreshold, getTreatMissingData
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getMetric
The metric to add the alarm on.Metric objects can be obtained from most resources, or you can construct custom Metric objects by instantiating one.
-
builder
- Returns:
- a
AlarmProps.Builder
ofAlarmProps
-