Class CfnServiceLevelObjectivePropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
Use SLOs to set and track specific target levels for the reliability and availability of your applications and services. SLOs use service level indicators (SLIs) to calculate whether the application is performing at the level that you want.
Create an SLO to set a target for a service operation, or service dependency's availability or latency. CloudWatch measures this target frequently you can find whether it has been breached.
The target performance quality that is defined for an SLO is the attainment goal . An attainment goal is the percentage of time or requests that the SLI is expected to meet the threshold over each time interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.
When you create an SLO, you specify whether it is a period-based SLO or a request-based SLO . Each type of SLO has a different way of evaluating your application's performance against its attainment goal.
- A period-based SLO uses defined periods of time within a specified total time interval. For each period of time, Application Signals determines whether the application met its goal. The attainment rate is calculated as the
number of good periods/number of total periods.
For example, for a period-based SLO, meeting an attainment goal of 99.9% means that within your interval, your application must meet its performance goal during at least 99.9% of the time periods.
- A request-based SLO doesn't use pre-defined periods of time. Instead, the SLO measures
number of good requests/number of total requestsduring the interval. At any time, you can find the ratio of good requests to total requests for the interval up to the time stamp that you specify, and measure that ratio against the goal set in your SLO.
After you have created an SLO, you can retrieve error budget reports for it. An error budget is the amount of time or amount of requests that your application can be non-compliant with the SLO's goal, and still have your application meet the goal.
- For a period-based SLO, the error budget starts at a number defined by the highest number of periods that can fail to meet the threshold, while still meeting the overall goal. The remaining error budget decreases with every failed period that is recorded. The error budget within one interval can never increase.
For example, an SLO with a threshold that 99.95% of requests must be completed under 2000ms every month translates to an error budget of 21.9 minutes of downtime per month.
- For a request-based SLO, the remaining error budget is dynamic and can increase or decrease, depending on the ratio of good requests to total requests.
When you call this operation, Application Signals creates the AWSServiceRoleForCloudWatchApplicationSignals service-linked role, if it doesn't already exist in your account. This service- linked role has the following permissions:
xray:GetServiceGraphlogs:StartQuerylogs:GetQueryResultscloudwatch:GetMetricDatacloudwatch:ListMetricstag:GetResourcesautoscaling:DescribeAutoScalingGroups
You can easily set SLO targets for your applications, and their dependencies, that are discovered by Application Signals, using critical metrics such as latency and availability. You can also set SLOs against any CloudWatch metric or math expression that produces a time series.
You can't create an SLO for a service operation that was discovered by Application Signals until after that operation has reported standard metrics to Application Signals.
You cannot change from a period-based SLO to a request-based SLO, or change from a request-based SLO to a period-based SLO.
For more information about SLOs, see Service level objectives (SLOs) .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cfnpropertymixins.services.applicationsignals.*;
import software.amazon.awscdk.*;
IMergeStrategy mergeStrategy;
CfnServiceLevelObjectivePropsMixin cfnServiceLevelObjectivePropsMixin = CfnServiceLevelObjectivePropsMixin.Builder.create(CfnServiceLevelObjectiveMixinProps.builder()
.burnRateConfigurations(List.of(BurnRateConfigurationProperty.builder()
.lookBackWindowMinutes(123)
.build()))
.description("description")
.exclusionWindows(List.of(ExclusionWindowProperty.builder()
.reason("reason")
.recurrenceRule(RecurrenceRuleProperty.builder()
.expression("expression")
.build())
.startTime("startTime")
.window(WindowProperty.builder()
.duration(123)
.durationUnit("durationUnit")
.build())
.build()))
.goal(GoalProperty.builder()
.attainmentGoal(123)
.interval(IntervalProperty.builder()
.calendarInterval(CalendarIntervalProperty.builder()
.duration(123)
.durationUnit("durationUnit")
.startTime(123)
.build())
.rollingInterval(RollingIntervalProperty.builder()
.duration(123)
.durationUnit("durationUnit")
.build())
.build())
.warningThreshold(123)
.build())
.name("name")
.requestBasedSli(RequestBasedSliProperty.builder()
.comparisonOperator("comparisonOperator")
.metricThreshold(123)
.requestBasedSliMetric(RequestBasedSliMetricProperty.builder()
.dependencyConfig(DependencyConfigProperty.builder()
.dependencyKeyAttributes(Map.of(
"dependencyKeyAttributesKey", "dependencyKeyAttributes"))
.dependencyOperationName("dependencyOperationName")
.build())
.keyAttributes(Map.of(
"keyAttributesKey", "keyAttributes"))
.metricType("metricType")
.monitoredRequestCountMetric(MonitoredRequestCountMetricProperty.builder()
.badCountMetric(List.of(MetricDataQueryProperty.builder()
.accountId("accountId")
.expression("expression")
.id("id")
.metricStat(MetricStatProperty.builder()
.metric(MetricProperty.builder()
.dimensions(List.of(DimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricName("metricName")
.namespace("namespace")
.build())
.period(123)
.stat("stat")
.unit("unit")
.build())
.returnData(false)
.build()))
.goodCountMetric(List.of(MetricDataQueryProperty.builder()
.accountId("accountId")
.expression("expression")
.id("id")
.metricStat(MetricStatProperty.builder()
.metric(MetricProperty.builder()
.dimensions(List.of(DimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricName("metricName")
.namespace("namespace")
.build())
.period(123)
.stat("stat")
.unit("unit")
.build())
.returnData(false)
.build()))
.build())
.operationName("operationName")
.totalRequestCountMetric(List.of(MetricDataQueryProperty.builder()
.accountId("accountId")
.expression("expression")
.id("id")
.metricStat(MetricStatProperty.builder()
.metric(MetricProperty.builder()
.dimensions(List.of(DimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricName("metricName")
.namespace("namespace")
.build())
.period(123)
.stat("stat")
.unit("unit")
.build())
.returnData(false)
.build()))
.build())
.build())
.sli(SliProperty.builder()
.comparisonOperator("comparisonOperator")
.metricThreshold(123)
.sliMetric(SliMetricProperty.builder()
.dependencyConfig(DependencyConfigProperty.builder()
.dependencyKeyAttributes(Map.of(
"dependencyKeyAttributesKey", "dependencyKeyAttributes"))
.dependencyOperationName("dependencyOperationName")
.build())
.keyAttributes(Map.of(
"keyAttributesKey", "keyAttributes"))
.metricDataQueries(List.of(MetricDataQueryProperty.builder()
.accountId("accountId")
.expression("expression")
.id("id")
.metricStat(MetricStatProperty.builder()
.metric(MetricProperty.builder()
.dimensions(List.of(DimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricName("metricName")
.namespace("namespace")
.build())
.period(123)
.stat("stat")
.unit("unit")
.build())
.returnData(false)
.build()))
.metricType("metricType")
.operationName("operationName")
.periodSeconds(123)
.statistic("statistic")
.build())
.build())
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build())
.strategy(mergeStrategy)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnServiceLevelObjectivePropsMixin.static interfaceThis object defines the length of the look-back window used to calculate one burn rate metric for this SLO.static interfaceIf the interval for this service level objective is a calendar interval, this structure contains the interval specifications.static interfaceIdentifies the dependency using theDependencyKeyAttributesandDependencyOperationName.static interfaceA dimension is a name/value pair that is part of the identity of a metric.static interfaceThe time window to be excluded from the SLO performance metrics.static interfaceThis structure contains the attributes that determine the goal of an SLO.static interfaceThe time period used to evaluate the SLO.static interfaceUse this structure to define a metric or metric math expression that you want to use as for a service level objective.static interfaceThis structure defines the metric used for a service level indicator, including the metric name, namespace, and dimensions.static interfaceThis structure defines the metric to be used as the service level indicator, along with the statistics, period, and unit.static interfaceThis structure defines the metric that is used as the "good request" or "bad request" value for a request-based SLO.static interfaceThe recurrence rule for the time exclusion window.static interfaceThis structure contains the information about the metric that is used for a request-based SLO.static interfaceThis structure contains information about the performance metric that a request-based SLO monitors.static interfaceIf the interval for this SLO is a rolling interval, this structure contains the interval specifications.static interfaceUse this structure to specify the metric to be used for the SLO.static interfaceThis structure specifies the information about the service and the performance metric that an SLO is to monitor.static interfaceThe start and end time of the time exclusion window.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::ApplicationSignals::ServiceLevelObjective.CfnServiceLevelObjectivePropsMixin(CfnServiceLevelObjectiveMixinProps props, CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::ApplicationSignals::ServiceLevelObjective.protectedCfnServiceLevelObjectivePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnServiceLevelObjectivePropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnServiceLevelObjectiveMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_PROPERTY_KEYS
-
-
Constructor Details
-
CfnServiceLevelObjectivePropsMixin
protected CfnServiceLevelObjectivePropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
CfnServiceLevelObjectivePropsMixin
protected CfnServiceLevelObjectivePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnServiceLevelObjectivePropsMixin
@Stability(Stable) public CfnServiceLevelObjectivePropsMixin(@NotNull CfnServiceLevelObjectiveMixinProps props, @Nullable CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::ApplicationSignals::ServiceLevelObjective.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnServiceLevelObjectivePropsMixin
@Stability(Stable) public CfnServiceLevelObjectivePropsMixin(@NotNull CfnServiceLevelObjectiveMixinProps props) Create a mixin to apply properties toAWS::ApplicationSignals::ServiceLevelObjective.- Parameters:
props- L1 properties to apply. This parameter is required.
-
-
Method Details
-
applyTo
@Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct) Apply the mixin properties to the construct. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-