CfnServiceLevelObjective
- class aws_cdk.aws_applicationsignals.CfnServiceLevelObjective(scope, id, *, name, description=None, goal=None, request_based_sli=None, sli=None, tags=None)
Bases:
CfnResource
Creates or updates 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 . 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 requests
during 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:GetServiceGraph
logs:StartQuery
logs:GetQueryResults
cloudwatch:GetMetricData
cloudwatch:ListMetrics
tag:GetResources
autoscaling:DescribeAutoScalingGroups
You can easily 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 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) .
- See:
- CloudformationResource:
AWS::ApplicationSignals::ServiceLevelObjective
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals cfn_service_level_objective = applicationsignals.CfnServiceLevelObjective(self, "MyCfnServiceLevelObjective", name="name", # the properties below are optional description="description", goal=applicationsignals.CfnServiceLevelObjective.GoalProperty( attainment_goal=123, interval=applicationsignals.CfnServiceLevelObjective.IntervalProperty( calendar_interval=applicationsignals.CfnServiceLevelObjective.CalendarIntervalProperty( duration=123, duration_unit="durationUnit", start_time=123 ), rolling_interval=applicationsignals.CfnServiceLevelObjective.RollingIntervalProperty( duration=123, duration_unit="durationUnit" ) ), warning_threshold=123 ), request_based_sli=applicationsignals.CfnServiceLevelObjective.RequestBasedSliProperty( request_based_sli_metric=applicationsignals.CfnServiceLevelObjective.RequestBasedSliMetricProperty( key_attributes={ "key_attributes_key": "keyAttributes" }, metric_type="metricType", monitored_request_count_metric=applicationsignals.CfnServiceLevelObjective.MonitoredRequestCountMetricProperty( bad_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )], good_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )] ), operation_name="operationName", total_request_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )] ), # the properties below are optional comparison_operator="comparisonOperator", metric_threshold=123 ), sli=applicationsignals.CfnServiceLevelObjective.SliProperty( comparison_operator="comparisonOperator", metric_threshold=123, sli_metric=applicationsignals.CfnServiceLevelObjective.SliMetricProperty( key_attributes={ "key_attributes_key": "keyAttributes" }, metric_data_queries=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )], metric_type="metricType", operation_name="operationName", period_seconds=123, statistic="statistic" ) ), tags=[CfnTag( key="key", value="value" )] )
- Parameters:
scope (
Construct
) – Scope in which this resource is defined.id (
str
) – Construct identifier for this resource (unique in its scope).name (
str
) – A name for this SLO.description (
Optional
[str
]) – An optional description for this SLO. Default: - “No description”goal (
Union
[IResolvable
,GoalProperty
,Dict
[str
,Any
],None
]) – This structure contains the attributes that determine the goal of an SLO. This includes the time period for evaluation and the attainment threshold.request_based_sli (
Union
[IResolvable
,RequestBasedSliProperty
,Dict
[str
,Any
],None
]) – A structure containing information about the performance metric that this SLO monitors, if this is a request-based SLO.sli (
Union
[IResolvable
,SliProperty
,Dict
[str
,Any
],None
]) – A structure containing information about the performance metric that this SLO monitors, if this is a period-based SLO.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – 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:TagResource permission. 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.
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_dependency(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- add_depends_on(target)
(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
- Parameters:
target (
CfnResource
) –- Deprecated:
use addDependency
- Stability:
deprecated
- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT
). A list of resources that support this policy can be found in the following link:- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.
- See:
- Return type:
None
- get_att(attribute_name, type_hint=None)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.type_hint (
Optional
[ResolutionTypeHint
]) –
- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) – tree inspector to collect and process attributes.- Return type:
None
- obtain_dependencies()
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
- Return type:
List
[Union
[Stack
,CfnResource
]]
- obtain_resource_dependencies()
Get a shallow copy of dependencies between this resource and other resources in the same stack.
- Return type:
List
[CfnResource
]
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- remove_dependency(target)
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- replace_dependency(target, new_target)
Replaces one dependency with another.
- Parameters:
target (
CfnResource
) – The dependency to replace.new_target (
CfnResource
) – The new dependency to add.
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::ApplicationSignals::ServiceLevelObjective'
- attr_arn
The ARN of this SLO.
- CloudformationAttribute:
Arn
- attr_created_time
The date and time that this SLO was created.
- CloudformationAttribute:
CreatedTime
- attr_evaluation_type
Displays whether this is a period-based SLO or a request-based SLO.
- CloudformationAttribute:
EvaluationType
- attr_last_updated_time
The time that this SLO was most recently updated.
- CloudformationAttribute:
LastUpdatedTime
- cdk_tag_manager
Tag Manager which manages the tags for this resource.
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- description
An optional description for this SLO.
- goal
This structure contains the attributes that determine the goal of an SLO.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- name
A name for this SLO.
- node
The tree node.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- request_based_sli
A structure containing information about the performance metric that this SLO monitors, if this is a request-based SLO.
- sli
A structure containing information about the performance metric that this SLO monitors, if this is a period-based SLO.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
A list of key-value pairs to associate with the SLO.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(x)
Check whether the given object is a CfnResource.
- Parameters:
x (
Any
) –- Return type:
bool
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
CalendarIntervalProperty
- class CfnServiceLevelObjective.CalendarIntervalProperty(*, duration, duration_unit, start_time)
Bases:
object
If the interval for this service level objective is a calendar interval, this structure contains the interval specifications.
- Parameters:
duration (
Union
[int
,float
]) – Specifies the duration of each calendar interval. For example, ifDuration
is1
andDurationUnit
isMONTH
, each interval is one month, aligned with the calendar.duration_unit (
str
) – Specifies the calendar interval unit.start_time (
Union
[int
,float
]) – The date and time when you want the first interval to start. Be sure to choose a time that configures the intervals the way that you want. For example, if you want weekly intervals starting on Mondays at 6 a.m., be sure to specify a start time that is a Monday at 6 a.m. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example:1698778057
As soon as one calendar interval ends, another automatically begins.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals calendar_interval_property = applicationsignals.CfnServiceLevelObjective.CalendarIntervalProperty( duration=123, duration_unit="durationUnit", start_time=123 )
Attributes
- duration
Specifies the duration of each calendar interval.
For example, if
Duration
is1
andDurationUnit
isMONTH
, each interval is one month, aligned with the calendar.
- duration_unit
Specifies the calendar interval unit.
- start_time
The date and time when you want the first interval to start.
Be sure to choose a time that configures the intervals the way that you want. For example, if you want weekly intervals starting on Mondays at 6 a.m., be sure to specify a start time that is a Monday at 6 a.m.
When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example:
1698778057
As soon as one calendar interval ends, another automatically begins.
DimensionProperty
- class CfnServiceLevelObjective.DimensionProperty(*, name, value)
Bases:
object
A dimension is a name/value pair that is part of the identity of a metric.
Because dimensions are part of the unique identifier for a metric, whenever you add a unique name/value pair to one of your metrics, you are creating a new variation of that metric. For example, many Amazon EC2 metrics publish
InstanceId
as a dimension name, and the actual instance ID as the value for that dimension.You can assign up to 30 dimensions to a metric.
- Parameters:
name (
str
) – The name of the dimension. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (:
). ASCII control characters are not supported as part of dimension names.value (
str
) – The value of the dimension. Dimension values must contain only ASCII characters and must include at least one non-whitespace character. ASCII control characters are not supported as part of dimension values.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals dimension_property = applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )
Attributes
- name
The name of the dimension.
Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (
:
). ASCII control characters are not supported as part of dimension names.
- value
The value of the dimension.
Dimension values must contain only ASCII characters and must include at least one non-whitespace character. ASCII control characters are not supported as part of dimension values.
GoalProperty
- class CfnServiceLevelObjective.GoalProperty(*, attainment_goal=None, interval=None, warning_threshold=None)
Bases:
object
This structure contains the attributes that determine the goal of an SLO.
This includes the time period for evaluation and the attainment threshold.
- Parameters:
attainment_goal (
Union
[int
,float
,None
]) – The threshold that determines if the goal is being met. If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the 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. If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal. If you omit this parameter, 99 is used to represent 99% as the attainment goal.interval (
Union
[IResolvable
,IntervalProperty
,Dict
[str
,Any
],None
]) – The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval. If you omit this parameter, a rolling interval of 7 days is used.warning_threshold (
Union
[int
,float
,None
]) – The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals goal_property = applicationsignals.CfnServiceLevelObjective.GoalProperty( attainment_goal=123, interval=applicationsignals.CfnServiceLevelObjective.IntervalProperty( calendar_interval=applicationsignals.CfnServiceLevelObjective.CalendarIntervalProperty( duration=123, duration_unit="durationUnit", start_time=123 ), rolling_interval=applicationsignals.CfnServiceLevelObjective.RollingIntervalProperty( duration=123, duration_unit="durationUnit" ) ), warning_threshold=123 )
Attributes
- attainment_goal
The threshold that determines if the goal is being met.
If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the 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.
If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.
If you omit this parameter, 99 is used to represent 99% as the attainment goal.
- interval
The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.
If you omit this parameter, a rolling interval of 7 days is used.
- warning_threshold
The percentage of remaining budget over total budget that you want to get warnings for.
If you omit this parameter, the default of 50.0 is used.
IntervalProperty
- class CfnServiceLevelObjective.IntervalProperty(*, calendar_interval=None, rolling_interval=None)
Bases:
object
The time period used to evaluate the SLO.
It can be either a calendar interval or rolling interval.
- Parameters:
calendar_interval (
Union
[IResolvable
,CalendarIntervalProperty
,Dict
[str
,Any
],None
]) – If the interval is a calendar interval, this structure contains the interval specifications.rolling_interval (
Union
[IResolvable
,RollingIntervalProperty
,Dict
[str
,Any
],None
]) – If the interval is a rolling interval, this structure contains the interval specifications.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals interval_property = applicationsignals.CfnServiceLevelObjective.IntervalProperty( calendar_interval=applicationsignals.CfnServiceLevelObjective.CalendarIntervalProperty( duration=123, duration_unit="durationUnit", start_time=123 ), rolling_interval=applicationsignals.CfnServiceLevelObjective.RollingIntervalProperty( duration=123, duration_unit="durationUnit" ) )
Attributes
- calendar_interval
If the interval is a calendar interval, this structure contains the interval specifications.
- rolling_interval
If the interval is a rolling interval, this structure contains the interval specifications.
MetricDataQueryProperty
- class CfnServiceLevelObjective.MetricDataQueryProperty(*, id, account_id=None, expression=None, metric_stat=None, return_data=None)
Bases:
object
Use this structure to define a metric or metric math expression that you want to use as for a service level objective.
Each
MetricDataQuery
in theMetricDataQueries
array specifies either a metric to retrieve, or a metric math expression to be performed on retrieved metrics. A singleMetricDataQueries
array can include as many as 20MetricDataQuery
structures in the array. The 20 structures can include as many as 10 structures that contain aMetricStat
parameter to retrieve a metric, and as many as 10 structures that contain theExpression
parameter to perform a math expression. Of thoseExpression
structures, exactly one must have true as the value forReturnData
. The result of this expression used for the SLO.For more information about metric math expressions, see Use metric math .
Within each
MetricDataQuery
object, you must specify eitherExpression
orMetricStat
but not both.- Parameters:
id (
str
) – A short name used to tie this object to the results in the response. ThisId
must be unique within aMetricDataQueries
array. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the metric math expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.account_id (
Optional
[str
]) – The ID of the account where this metric is located. If you are performing this operation in a monitoring account, use this to specify which source account to retrieve this metric from.expression (
Optional
[str
]) – This field can contain a metric math expression to be performed on the other metrics that you are retrieving within thisMetricDataQueries
structure. A math expression can use theId
of the other metrics or queries to refer to those metrics, and can also use theId
of other expressions to use the result of those expressions. For more information about metric math expressions, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide . Within eachMetricDataQuery
object, you must specify eitherExpression
orMetricStat
but not both.metric_stat (
Union
[IResolvable
,MetricStatProperty
,Dict
[str
,Any
],None
]) – A metric to be used directly for the SLO, or to be used in the math expression that will be used for the SLO. Within oneMetricDataQuery
object, you must specify eitherExpression
orMetricStat
but not both.return_data (
Union
[bool
,IResolvable
,None
]) – Use this only if you are using a metric math expression for the SLO. Specifytrue
forReturnData
for only the one expression result to use as the alarm. For all other metrics and expressions in the sameCreateServiceLevelObjective
operation, specifyReturnData
asfalse
.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals metric_data_query_property = applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )
Attributes
- account_id
The ID of the account where this metric is located.
If you are performing this operation in a monitoring account, use this to specify which source account to retrieve this metric from.
- expression
This field can contain a metric math expression to be performed on the other metrics that you are retrieving within this
MetricDataQueries
structure.A math expression can use the
Id
of the other metrics or queries to refer to those metrics, and can also use theId
of other expressions to use the result of those expressions. For more information about metric math expressions, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide .Within each
MetricDataQuery
object, you must specify eitherExpression
orMetricStat
but not both.
- id
A short name used to tie this object to the results in the response.
This
Id
must be unique within aMetricDataQueries
array. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the metric math expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.
- metric_stat
A metric to be used directly for the SLO, or to be used in the math expression that will be used for the SLO.
Within one
MetricDataQuery
object, you must specify eitherExpression
orMetricStat
but not both.
- return_data
Use this only if you are using a metric math expression for the SLO.
Specify
true
forReturnData
for only the one expression result to use as the alarm. For all other metrics and expressions in the sameCreateServiceLevelObjective
operation, specifyReturnData
asfalse
.
MetricProperty
- class CfnServiceLevelObjective.MetricProperty(*, dimensions=None, metric_name=None, namespace=None)
Bases:
object
This structure defines the metric used for a service level indicator, including the metric name, namespace, and dimensions.
- Parameters:
dimensions (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,DimensionProperty
,Dict
[str
,Any
]]],None
]) – An array of one or more dimensions to use to define the metric that you want to use. For more information, see Dimensions .metric_name (
Optional
[str
]) – The name of the metric to use.namespace (
Optional
[str
]) – The namespace of the metric. For more information, see Namespaces .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals metric_property = applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" )
Attributes
- dimensions
An array of one or more dimensions to use to define the metric that you want to use.
For more information, see Dimensions .
- metric_name
The name of the metric to use.
- namespace
The namespace of the metric.
For more information, see Namespaces .
MetricStatProperty
- class CfnServiceLevelObjective.MetricStatProperty(*, metric, period, stat, unit=None)
Bases:
object
This structure defines the metric to be used as the service level indicator, along with the statistics, period, and unit.
- Parameters:
metric (
Union
[IResolvable
,MetricProperty
,Dict
[str
,Any
]]) – The metric to use as the service level indicator, including the metric name, namespace, and dimensions.period (
Union
[int
,float
]) – The granularity, in seconds, to be used for the metric. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by aPutMetricData
call that includes aStorageResolution
of 1 second.stat (
str
) – The statistic to use for comparison to the threshold. It can be any CloudWatch statistic or extended statistic. For more information about statistics, see CloudWatch statistics definitions .unit (
Optional
[str
]) – If you omitUnit
then all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals metric_stat_property = applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" )
Attributes
- metric
The metric to use as the service level indicator, including the metric name, namespace, and dimensions.
- period
The granularity, in seconds, to be used for the metric.
For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a
PutMetricData
call that includes aStorageResolution
of 1 second.
- stat
The statistic to use for comparison to the threshold.
It can be any CloudWatch statistic or extended statistic. For more information about statistics, see CloudWatch statistics definitions .
- unit
If you omit
Unit
then all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch.If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.
MonitoredRequestCountMetricProperty
- class CfnServiceLevelObjective.MonitoredRequestCountMetricProperty(*, bad_count_metric=None, good_count_metric=None)
Bases:
object
This structure defines the metric that is used as the “good request” or “bad request” value for a request-based SLO.
This value observed for the metric defined in
TotalRequestCountMetric
is divided by the number found forMonitoredRequestCountMetric
to determine the percentage of successful requests that this SLO tracks.- Parameters:
bad_count_metric (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,MetricDataQueryProperty
,Dict
[str
,Any
]]],None
]) – If you want to count “bad requests” to determine the percentage of successful requests for this request-based SLO, specify the metric to use as “bad requests” in this structure.good_count_metric (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,MetricDataQueryProperty
,Dict
[str
,Any
]]],None
]) – If you want to count “good requests” to determine the percentage of successful requests for this request-based SLO, specify the metric to use as “good requests” in this structure.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals monitored_request_count_metric_property = applicationsignals.CfnServiceLevelObjective.MonitoredRequestCountMetricProperty( bad_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )], good_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )] )
Attributes
- bad_count_metric
If you want to count “bad requests” to determine the percentage of successful requests for this request-based SLO, specify the metric to use as “bad requests” in this structure.
- good_count_metric
If you want to count “good requests” to determine the percentage of successful requests for this request-based SLO, specify the metric to use as “good requests” in this structure.
RequestBasedSliMetricProperty
- class CfnServiceLevelObjective.RequestBasedSliMetricProperty(*, key_attributes=None, metric_type=None, monitored_request_count_metric=None, operation_name=None, total_request_count_metric=None)
Bases:
object
This structure contains the information about the metric that is used for a request-based SLO.
- Parameters:
key_attributes (
Union
[IResolvable
,Mapping
[str
,str
],None
]) – This is a string-to-string map that contains information about the type of object that this SLO is related to. It can include the following fields. -Type
designates the type of object that this SLO is related to. -ResourceType
specifies the type of the resource. This field is used only when the value of theType
field isResource
orAWS::Resource
. -Name
specifies the name of the object. This is used only if the value of theType
field isService
,RemoteService
, orAWS::Service
. -Identifier
identifies the resource objects of this resource. This is used only if the value of theType
field isResource
orAWS::Resource
. -Environment
specifies the location where this object is hosted, or what it belongs to.metric_type (
Optional
[str
]) – If the SLO monitors either theLATENCY
orAVAILABILITY
metric that Application Signals collects, this field displays which of those metrics is used.monitored_request_count_metric (
Union
[IResolvable
,MonitoredRequestCountMetricProperty
,Dict
[str
,Any
],None
]) – Use this structure to define the metric that you want to use as the “good request” or “bad request” value for a request-based SLO. This value observed for the metric defined inTotalRequestCountMetric
will be divided by the number found forMonitoredRequestCountMetric
to determine the percentage of successful requests that this SLO tracks.operation_name (
Optional
[str
]) – If the SLO monitors a specific operation of the service, this field displays that operation name.total_request_count_metric (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,MetricDataQueryProperty
,Dict
[str
,Any
]]],None
]) – This structure defines the metric that is used as the “total requests” number for a request-based SLO. The number observed for this metric is divided by the number of “good requests” or “bad requests” that is observed for the metric defined inMonitoredRequestCountMetric
.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals request_based_sli_metric_property = applicationsignals.CfnServiceLevelObjective.RequestBasedSliMetricProperty( key_attributes={ "key_attributes_key": "keyAttributes" }, metric_type="metricType", monitored_request_count_metric=applicationsignals.CfnServiceLevelObjective.MonitoredRequestCountMetricProperty( bad_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )], good_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )] ), operation_name="operationName", total_request_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )] )
Attributes
- key_attributes
This is a string-to-string map that contains information about the type of object that this SLO is related to.
It can include the following fields.
Type
designates the type of object that this SLO is related to.ResourceType
specifies the type of the resource. This field is used only when the value of theType
field isResource
orAWS::Resource
.Name
specifies the name of the object. This is used only if the value of theType
field isService
,RemoteService
, orAWS::Service
.Identifier
identifies the resource objects of this resource. This is used only if the value of theType
field isResource
orAWS::Resource
.Environment
specifies the location where this object is hosted, or what it belongs to.
- metric_type
If the SLO monitors either the
LATENCY
orAVAILABILITY
metric that Application Signals collects, this field displays which of those metrics is used.
- monitored_request_count_metric
Use this structure to define the metric that you want to use as the “good request” or “bad request” value for a request-based SLO.
This value observed for the metric defined in
TotalRequestCountMetric
will be divided by the number found forMonitoredRequestCountMetric
to determine the percentage of successful requests that this SLO tracks.
- operation_name
If the SLO monitors a specific operation of the service, this field displays that operation name.
- total_request_count_metric
This structure defines the metric that is used as the “total requests” number for a request-based SLO.
The number observed for this metric is divided by the number of “good requests” or “bad requests” that is observed for the metric defined in
MonitoredRequestCountMetric
.
RequestBasedSliProperty
- class CfnServiceLevelObjective.RequestBasedSliProperty(*, request_based_sli_metric, comparison_operator=None, metric_threshold=None)
Bases:
object
This structure contains information about the performance metric that a request-based SLO monitors.
- Parameters:
request_based_sli_metric (
Union
[IResolvable
,RequestBasedSliMetricProperty
,Dict
[str
,Any
]]) – A structure that contains information about the metric that the SLO monitors.comparison_operator (
Optional
[str
]) – The arithmetic operation used when comparing the specified metric to the threshold.metric_threshold (
Union
[int
,float
,None
]) – This value is the threshold that the observed metric values of the SLI metric are compared to.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals request_based_sli_property = applicationsignals.CfnServiceLevelObjective.RequestBasedSliProperty( request_based_sli_metric=applicationsignals.CfnServiceLevelObjective.RequestBasedSliMetricProperty( key_attributes={ "key_attributes_key": "keyAttributes" }, metric_type="metricType", monitored_request_count_metric=applicationsignals.CfnServiceLevelObjective.MonitoredRequestCountMetricProperty( bad_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )], good_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )] ), operation_name="operationName", total_request_count_metric=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )] ), # the properties below are optional comparison_operator="comparisonOperator", metric_threshold=123 )
Attributes
- comparison_operator
The arithmetic operation used when comparing the specified metric to the threshold.
- metric_threshold
This value is the threshold that the observed metric values of the SLI metric are compared to.
- request_based_sli_metric
A structure that contains information about the metric that the SLO monitors.
RollingIntervalProperty
- class CfnServiceLevelObjective.RollingIntervalProperty(*, duration, duration_unit)
Bases:
object
If the interval for this SLO is a rolling interval, this structure contains the interval specifications.
- Parameters:
duration (
Union
[int
,float
]) – Specifies the duration of each rolling interval. For example, ifDuration
is7
andDurationUnit
isDAY
, each rolling interval is seven days.duration_unit (
str
) – Specifies the rolling interval unit.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals rolling_interval_property = applicationsignals.CfnServiceLevelObjective.RollingIntervalProperty( duration=123, duration_unit="durationUnit" )
Attributes
- duration
Specifies the duration of each rolling interval.
For example, if
Duration
is7
andDurationUnit
isDAY
, each rolling interval is seven days.
- duration_unit
Specifies the rolling interval unit.
SliMetricProperty
- class CfnServiceLevelObjective.SliMetricProperty(*, key_attributes=None, metric_data_queries=None, metric_type=None, operation_name=None, period_seconds=None, statistic=None)
Bases:
object
Use this structure to specify the metric to be used for the SLO.
- Parameters:
key_attributes (
Union
[IResolvable
,Mapping
[str
,str
],None
]) – If this SLO is related to a metric collected by Application Signals, you must use this field to specify which service the SLO metric is related to. To do so, you must specify at least theType
,Name
, andEnvironment
attributes. This is a string-to-string map. It can include the following fields. -Type
designates the type of object this is. -ResourceType
specifies the type of the resource. This field is used only when the value of theType
field isResource
orAWS::Resource
. -Name
specifies the name of the object. This is used only if the value of theType
field isService
,RemoteService
, orAWS::Service
. -Identifier
identifies the resource objects of this resource. This is used only if the value of theType
field isResource
orAWS::Resource
. -Environment
specifies the location where this object is hosted, or what it belongs to.metric_data_queries (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,MetricDataQueryProperty
,Dict
[str
,Any
]]],None
]) – If this SLO monitors a CloudWatch metric or the result of a CloudWatch metric math expression, use this structure to specify that metric or expression.metric_type (
Optional
[str
]) – If the SLO is to monitor either theLATENCY
orAVAILABILITY
metric that Application Signals collects, use this field to specify which of those metrics is used.operation_name (
Optional
[str
]) – If the SLO is to monitor a specific operation of the service, use this field to specify the name of that operation.period_seconds (
Union
[int
,float
,None
]) – The number of seconds to use as the period for SLO evaluation. Your application’s performance is compared to the SLI during each period. For each period, the application is determined to have either achieved or not achieved the necessary performance.statistic (
Optional
[str
]) –The statistic to use for comparison to the threshold. It can be any CloudWatch statistic or extended statistic. For more information about statistics, see CloudWatch statistics definitions .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals sli_metric_property = applicationsignals.CfnServiceLevelObjective.SliMetricProperty( key_attributes={ "key_attributes_key": "keyAttributes" }, metric_data_queries=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )], metric_type="metricType", operation_name="operationName", period_seconds=123, statistic="statistic" )
Attributes
- key_attributes
If this SLO is related to a metric collected by Application Signals, you must use this field to specify which service the SLO metric is related to.
To do so, you must specify at least the
Type
,Name
, andEnvironment
attributes.This is a string-to-string map. It can include the following fields.
Type
designates the type of object this is.ResourceType
specifies the type of the resource. This field is used only when the value of theType
field isResource
orAWS::Resource
.Name
specifies the name of the object. This is used only if the value of theType
field isService
,RemoteService
, orAWS::Service
.Identifier
identifies the resource objects of this resource. This is used only if the value of theType
field isResource
orAWS::Resource
.Environment
specifies the location where this object is hosted, or what it belongs to.
- metric_data_queries
If this SLO monitors a CloudWatch metric or the result of a CloudWatch metric math expression, use this structure to specify that metric or expression.
- metric_type
If the SLO is to monitor either the
LATENCY
orAVAILABILITY
metric that Application Signals collects, use this field to specify which of those metrics is used.
- operation_name
If the SLO is to monitor a specific operation of the service, use this field to specify the name of that operation.
- period_seconds
The number of seconds to use as the period for SLO evaluation.
Your application’s performance is compared to the SLI during each period. For each period, the application is determined to have either achieved or not achieved the necessary performance.
- statistic
The statistic to use for comparison to the threshold.
It can be any CloudWatch statistic or extended statistic. For more information about statistics, see CloudWatch statistics definitions .
SliProperty
- class CfnServiceLevelObjective.SliProperty(*, comparison_operator, metric_threshold, sli_metric)
Bases:
object
This structure specifies the information about the service and the performance metric that an SLO is to monitor.
- Parameters:
comparison_operator (
str
) – The arithmetic operation to use when comparing the specified metric to the threshold.metric_threshold (
Union
[int
,float
]) – The value that the SLI metric is compared to.sli_metric (
Union
[IResolvable
,SliMetricProperty
,Dict
[str
,Any
]]) – Use this structure to specify the metric to be used for the SLO.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_applicationsignals as applicationsignals sli_property = applicationsignals.CfnServiceLevelObjective.SliProperty( comparison_operator="comparisonOperator", metric_threshold=123, sli_metric=applicationsignals.CfnServiceLevelObjective.SliMetricProperty( key_attributes={ "key_attributes_key": "keyAttributes" }, metric_data_queries=[applicationsignals.CfnServiceLevelObjective.MetricDataQueryProperty( id="id", # the properties below are optional account_id="accountId", expression="expression", metric_stat=applicationsignals.CfnServiceLevelObjective.MetricStatProperty( metric=applicationsignals.CfnServiceLevelObjective.MetricProperty( dimensions=[applicationsignals.CfnServiceLevelObjective.DimensionProperty( name="name", value="value" )], metric_name="metricName", namespace="namespace" ), period=123, stat="stat", # the properties below are optional unit="unit" ), return_data=False )], metric_type="metricType", operation_name="operationName", period_seconds=123, statistic="statistic" ) )
Attributes
- comparison_operator
The arithmetic operation to use when comparing the specified metric to the threshold.
- metric_threshold
The value that the SLI metric is compared to.
- sli_metric
Use this structure to specify the metric to be used for the SLO.