create_service_level_objective
async
¶
create_service_level_objective(
name: ServiceLevelObjectiveName,
*,
config_overrides: Optional[AsyncApplicationSignalsClientConfig] = None,
description: Optional[ServiceLevelObjectiveDescription] = None,
sli_config: Optional[ServiceLevelIndicatorConfig] = None,
request_based_sli_config: Optional[RequestBasedServiceLevelIndicatorConfig] = None,
goal: Optional[Goal] = None,
tags: Optional[TagList] = None,
burn_rate_configurations: Optional[BurnRateConfigurations] = None,
create_recommended_slo: Optional[bool] = None,
auto_investigation_enabled: Optional[bool] = None,
) -> CreateServiceLevelObjectiveOutput
Creates a service level objective (SLO), which can help you ensure that your critical business operations are meeting customer expectations. 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 or operation’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.
You can set SLO targets for your applications 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.
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.
For more information about SLOs, see Service level objectives (SLOs).
When you perform a CreateServiceLevelObjective 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:GetServiceGraph -
logs:StartQuery -
logs:GetQueryResults -
cloudwatch:GetMetricData -
cloudwatch:ListMetrics -
tag:GetResources -
autoscaling:DescribeAutoScalingGroups
Parameters:
-
name(ServiceLevelObjectiveName) –A name for this SLO.
-
description(Optional[ServiceLevelObjectiveDescription], default:None) –An optional description for this SLO.
-
sli_config(Optional[ServiceLevelIndicatorConfig], default:None) –If this SLO is a period-based SLO, this structure defines the information about what performance metric this SLO will monitor.
You can't specify both
RequestBasedSliConfigandSliConfigin the same operation. -
request_based_sli_config(Optional[RequestBasedServiceLevelIndicatorConfig], default:None) –If this SLO is a request-based SLO, this structure defines the information about what performance metric this SLO will monitor.
You can't specify both
RequestBasedSliConfigandSliConfigin the same operation. -
goal(Optional[Goal], default:None) –This structure contains the attributes that determine the goal of the SLO.
-
tags(Optional[TagList], default:None) –A list of key-value pairs to associate with the SLO. You can associate as many as 50 tags with an SLO. To be able to associate tags with the SLO when you create the SLO, you must have the
cloudwatch:TagResourcepermission.Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
-
burn_rate_configurations(Optional[BurnRateConfigurations], default:None) –Use this array to create burn rates for this SLO. Each burn rate is a metric that indicates how fast the service is consuming the error budget, relative to the attainment goal of the SLO.
-
create_recommended_slo(Optional[bool], default:None) –Set this to
trueto create a recommended SLO out of the box. When set totrue, you don't need to specify theMetricThresholdorComparisonOperatorin theSliConfigorRequestBasedSliConfig. The default value isfalse.This is supported for SLOs on a service, service operation, or a dependency.
-
auto_investigation_enabled(Optional[bool], default:None) –Indicates whether DevOps Agent will automatically investigate this SLO when it is breached
Raises:
-
AccessDeniedException–You don't have sufficient permissions to perform this action.
-
ConflictException–This operation attempted to create a resource that already exists.
-
ServiceQuotaExceededException–This request exceeds a service quota.
-
ThrottlingException–The request was throttled because of quota limits.
-
ValidationException–The resource is not valid.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_application_signals/_services/async_application_signals.py
2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 | |