CloudWatchApplicationSignals / Client / batch_get_service_level_objective_budget_report
batch_get_service_level_objective_budget_report#
- CloudWatchApplicationSignals.Client.batch_get_service_level_objective_budget_report(**kwargs)#
Use this operation to retrieve one or more service level objective (SLO) budget reports.
An error budget is the amount of time or requests in an unhealthy state that your service can accumulate during an interval before your overall SLO budget health is breached and the SLO is considered to be unmet. For example, an SLO with a threshold of 99.95% and a monthly interval translates to an error budget of 21.9 minutes of downtime in a 30-day month.
Budget reports include a health indicator, the attainment value, and remaining budget.
For more information about SLO error budgets, see SLO concepts.
See also: AWS API Documentation
Request Syntax
response = client.batch_get_service_level_objective_budget_report( Timestamp=datetime(2015, 1, 1), SloIds=[ 'string', ] )
- Parameters:
Timestamp (datetime) –
[REQUIRED]
The date and time that you want the report to be for. It is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.
SloIds (list) –
[REQUIRED]
An array containing the IDs of the service level objectives that you want to include in the report.
(string) –
- Return type:
dict
- Returns:
Response Syntax
{ 'Timestamp': datetime(2015, 1, 1), 'Reports': [ { 'Arn': 'string', 'Name': 'string', 'EvaluationType': 'PeriodBased'|'RequestBased', 'BudgetStatus': 'OK'|'WARNING'|'BREACHED'|'INSUFFICIENT_DATA', 'Attainment': 123.0, 'TotalBudgetSeconds': 123, 'BudgetSecondsRemaining': 123, 'TotalBudgetRequests': 123, 'BudgetRequestsRemaining': 123, 'Sli': { 'SliMetric': { 'KeyAttributes': { 'string': 'string' }, 'OperationName': 'string', 'MetricType': 'LATENCY'|'AVAILABILITY', 'MetricDataQueries': [ { 'Id': 'string', 'MetricStat': { 'Metric': { 'Namespace': 'string', 'MetricName': 'string', 'Dimensions': [ { 'Name': 'string', 'Value': 'string' }, ] }, 'Period': 123, 'Stat': 'string', 'Unit': 'Microseconds'|'Milliseconds'|'Seconds'|'Bytes'|'Kilobytes'|'Megabytes'|'Gigabytes'|'Terabytes'|'Bits'|'Kilobits'|'Megabits'|'Gigabits'|'Terabits'|'Percent'|'Count'|'Bytes/Second'|'Kilobytes/Second'|'Megabytes/Second'|'Gigabytes/Second'|'Terabytes/Second'|'Bits/Second'|'Kilobits/Second'|'Megabits/Second'|'Gigabits/Second'|'Terabits/Second'|'Count/Second'|'None' }, 'Expression': 'string', 'Label': 'string', 'ReturnData': True|False, 'Period': 123, 'AccountId': 'string' }, ] }, 'MetricThreshold': 123.0, 'ComparisonOperator': 'GreaterThanOrEqualTo'|'GreaterThan'|'LessThan'|'LessThanOrEqualTo' }, 'RequestBasedSli': { 'RequestBasedSliMetric': { 'KeyAttributes': { 'string': 'string' }, 'OperationName': 'string', 'MetricType': 'LATENCY'|'AVAILABILITY', 'TotalRequestCountMetric': [ { 'Id': 'string', 'MetricStat': { 'Metric': { 'Namespace': 'string', 'MetricName': 'string', 'Dimensions': [ { 'Name': 'string', 'Value': 'string' }, ] }, 'Period': 123, 'Stat': 'string', 'Unit': 'Microseconds'|'Milliseconds'|'Seconds'|'Bytes'|'Kilobytes'|'Megabytes'|'Gigabytes'|'Terabytes'|'Bits'|'Kilobits'|'Megabits'|'Gigabits'|'Terabits'|'Percent'|'Count'|'Bytes/Second'|'Kilobytes/Second'|'Megabytes/Second'|'Gigabytes/Second'|'Terabytes/Second'|'Bits/Second'|'Kilobits/Second'|'Megabits/Second'|'Gigabits/Second'|'Terabits/Second'|'Count/Second'|'None' }, 'Expression': 'string', 'Label': 'string', 'ReturnData': True|False, 'Period': 123, 'AccountId': 'string' }, ], 'MonitoredRequestCountMetric': { 'GoodCountMetric': [ { 'Id': 'string', 'MetricStat': { 'Metric': { 'Namespace': 'string', 'MetricName': 'string', 'Dimensions': [ { 'Name': 'string', 'Value': 'string' }, ] }, 'Period': 123, 'Stat': 'string', 'Unit': 'Microseconds'|'Milliseconds'|'Seconds'|'Bytes'|'Kilobytes'|'Megabytes'|'Gigabytes'|'Terabytes'|'Bits'|'Kilobits'|'Megabits'|'Gigabits'|'Terabits'|'Percent'|'Count'|'Bytes/Second'|'Kilobytes/Second'|'Megabytes/Second'|'Gigabytes/Second'|'Terabytes/Second'|'Bits/Second'|'Kilobits/Second'|'Megabits/Second'|'Gigabits/Second'|'Terabits/Second'|'Count/Second'|'None' }, 'Expression': 'string', 'Label': 'string', 'ReturnData': True|False, 'Period': 123, 'AccountId': 'string' }, ], 'BadCountMetric': [ { 'Id': 'string', 'MetricStat': { 'Metric': { 'Namespace': 'string', 'MetricName': 'string', 'Dimensions': [ { 'Name': 'string', 'Value': 'string' }, ] }, 'Period': 123, 'Stat': 'string', 'Unit': 'Microseconds'|'Milliseconds'|'Seconds'|'Bytes'|'Kilobytes'|'Megabytes'|'Gigabytes'|'Terabytes'|'Bits'|'Kilobits'|'Megabits'|'Gigabits'|'Terabits'|'Percent'|'Count'|'Bytes/Second'|'Kilobytes/Second'|'Megabytes/Second'|'Gigabytes/Second'|'Terabytes/Second'|'Bits/Second'|'Kilobits/Second'|'Megabits/Second'|'Gigabits/Second'|'Terabits/Second'|'Count/Second'|'None' }, 'Expression': 'string', 'Label': 'string', 'ReturnData': True|False, 'Period': 123, 'AccountId': 'string' }, ] } }, 'MetricThreshold': 123.0, 'ComparisonOperator': 'GreaterThanOrEqualTo'|'GreaterThan'|'LessThan'|'LessThanOrEqualTo' }, 'Goal': { 'Interval': { 'RollingInterval': { 'DurationUnit': 'MINUTE'|'HOUR'|'DAY'|'MONTH', 'Duration': 123 }, 'CalendarInterval': { 'StartTime': datetime(2015, 1, 1), 'DurationUnit': 'MINUTE'|'HOUR'|'DAY'|'MONTH', 'Duration': 123 } }, 'AttainmentGoal': 123.0, 'WarningThreshold': 123.0 } }, ], 'Errors': [ { 'Name': 'string', 'Arn': 'string', 'ErrorCode': 'string', 'ErrorMessage': 'string' }, ] }
Response Structure
(dict) –
Timestamp (datetime) –
The date and time that the report is for. It is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC.
Reports (list) –
An array of structures, where each structure is one budget report.
(dict) –
A structure containing an SLO budget report that you have requested.
Arn (string) –
The ARN of the SLO that this report is for.
Name (string) –
The name of the SLO that this report is for.
EvaluationType (string) –
Displays whether this budget report is for a period-based SLO or a request-based SLO.
BudgetStatus (string) –
The status of this SLO, as it relates to the error budget for the entire time interval.
OK
means that the SLO had remaining budget above the warning threshold, as of the time that you specified inTimeStamp
.WARNING
means that the SLO’s remaining budget was below the warning threshold, as of the time that you specified inTimeStamp
.BREACHED
means that the SLO’s budget was exhausted, as of the time that you specified inTimeStamp
.INSUFFICIENT_DATA
means that the specified start and end times were before the SLO was created, or that attainment data is missing.
Attainment (float) –
A number between 0 and 100 that represents the success percentage of your application compared to the goal set by the SLO.
If this is a period-based SLO, the number is the percentage of time periods that the service has attained the SLO’s attainment goal, as of the time of the request.
If this is a request-based SLO, the number is the number of successful requests divided by the number of total requests, multiplied by 100, during the time range that you specified in your request.
TotalBudgetSeconds (integer) –
The total number of seconds in the error budget for the interval. This field is included only if the SLO is a period-based SLO.
BudgetSecondsRemaining (integer) –
The budget amount remaining before the SLO status becomes
BREACHING
, at the time specified in theTimestemp
parameter of the request. If this value is negative, then the SLO is already inBREACHING
status.This field is included only if the SLO is a period-based SLO.
TotalBudgetRequests (integer) –
This field is displayed only for request-based SLOs. It displays the total number of failed requests that can be tolerated during the time range between the start of the interval and the time stamp supplied in the budget report request. It is based on the total number of requests that occurred, and the percentage specified in the attainment goal. If the number of failed requests matches this number or is higher, then this SLO is currently breaching.
This number can go up and down between reports with different time stamps, based on both how many total requests occur.
BudgetRequestsRemaining (integer) –
This field is displayed only for request-based SLOs. It displays the number of failed requests that can be tolerated before any more successful requests occur, and still have the application meet its SLO goal.
This number can go up and down between different reports, based on both how many successful requests and how many failed requests occur in that time.
Sli (dict) –
A structure that contains information about the performance metric that this SLO monitors.
SliMetric (dict) –
A structure that contains information about the metric that the SLO monitors.
KeyAttributes (dict) –
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.
(string) –
(string) –
OperationName (string) –
If the SLO monitors a specific operation of the service, this field displays that operation name.
MetricType (string) –
If the SLO monitors either the
LATENCY
orAVAILABILITY
metric that Application Signals collects, this field displays which of those metrics is used.MetricDataQueries (list) –
If this SLO monitors a CloudWatch metric or the result of a CloudWatch metric math expression, this structure includes the information about that metric or expression.
(dict) –
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 CloudWatchUse metric math.
Within each
MetricDataQuery
object, you must specify eitherExpression
orMetricStat
but not both.Id (string) –
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.MetricStat (dict) –
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.Metric (dict) –
The metric to use as the service level indicator, including the metric name, namespace, and dimensions.
Namespace (string) –
The namespace of the metric. For more information, see Namespaces.
MetricName (string) –
The name of the metric to use.
Dimensions (list) –
An array of one or more dimensions to use to define the metric that you want to use. For more information, see Dimensions.
(dict) –
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.
Name (string) –
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 (string) –
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.
Period (integer) –
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 (string) –
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 (string) –
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.
Expression (string) –
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.Label (string) –
A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If
Label
is omitted, CloudWatch generates a default.You can put dynamic expressions into a label, so that it is more descriptive. For more information, see Using Dynamic Labels.
ReturnData (boolean) –
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
.Period (integer) –
The granularity, in seconds, of the returned data points for this 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.If the
StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
AccountId (string) –
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.
MetricThreshold (float) –
The value that the SLI metric is compared to.
ComparisonOperator (string) –
The arithmetic operation used when comparing the specified metric to the threshold.
RequestBasedSli (dict) –
This structure contains information about the performance metric that a request-based SLO monitors.
RequestBasedSliMetric (dict) –
A structure that contains information about the metric that the SLO monitors.
KeyAttributes (dict) –
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.
(string) –
(string) –
OperationName (string) –
If the SLO monitors a specific operation of the service, this field displays that operation name.
MetricType (string) –
If the SLO monitors either the
LATENCY
orAVAILABILITY
metric that Application Signals collects, this field displays which of those metrics is used.TotalRequestCountMetric (list) –
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
.(dict) –
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 CloudWatchUse metric math.
Within each
MetricDataQuery
object, you must specify eitherExpression
orMetricStat
but not both.Id (string) –
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.MetricStat (dict) –
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.Metric (dict) –
The metric to use as the service level indicator, including the metric name, namespace, and dimensions.
Namespace (string) –
The namespace of the metric. For more information, see Namespaces.
MetricName (string) –
The name of the metric to use.
Dimensions (list) –
An array of one or more dimensions to use to define the metric that you want to use. For more information, see Dimensions.
(dict) –
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.
Name (string) –
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 (string) –
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.
Period (integer) –
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 (string) –
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 (string) –
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.
Expression (string) –
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.Label (string) –
A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If
Label
is omitted, CloudWatch generates a default.You can put dynamic expressions into a label, so that it is more descriptive. For more information, see Using Dynamic Labels.
ReturnData (boolean) –
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
.Period (integer) –
The granularity, in seconds, of the returned data points for this 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.If the
StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
AccountId (string) –
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.
MonitoredRequestCountMetric (dict) –
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.Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
GoodCountMetric
,BadCountMetric
. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBER
as the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBER
is as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
GoodCountMetric (list) –
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.
(dict) –
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 CloudWatchUse metric math.
Within each
MetricDataQuery
object, you must specify eitherExpression
orMetricStat
but not both.Id (string) –
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.MetricStat (dict) –
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.Metric (dict) –
The metric to use as the service level indicator, including the metric name, namespace, and dimensions.
Namespace (string) –
The namespace of the metric. For more information, see Namespaces.
MetricName (string) –
The name of the metric to use.
Dimensions (list) –
An array of one or more dimensions to use to define the metric that you want to use. For more information, see Dimensions.
(dict) –
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.
Name (string) –
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 (string) –
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.
Period (integer) –
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 (string) –
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 (string) –
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.
Expression (string) –
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.Label (string) –
A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If
Label
is omitted, CloudWatch generates a default.You can put dynamic expressions into a label, so that it is more descriptive. For more information, see Using Dynamic Labels.
ReturnData (boolean) –
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
.Period (integer) –
The granularity, in seconds, of the returned data points for this 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.If the
StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
AccountId (string) –
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.
BadCountMetric (list) –
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.
(dict) –
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 CloudWatchUse metric math.
Within each
MetricDataQuery
object, you must specify eitherExpression
orMetricStat
but not both.Id (string) –
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.MetricStat (dict) –
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.Metric (dict) –
The metric to use as the service level indicator, including the metric name, namespace, and dimensions.
Namespace (string) –
The namespace of the metric. For more information, see Namespaces.
MetricName (string) –
The name of the metric to use.
Dimensions (list) –
An array of one or more dimensions to use to define the metric that you want to use. For more information, see Dimensions.
(dict) –
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.
Name (string) –
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 (string) –
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.
Period (integer) –
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 (string) –
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 (string) –
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.
Expression (string) –
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.Label (string) –
A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If
Label
is omitted, CloudWatch generates a default.You can put dynamic expressions into a label, so that it is more descriptive. For more information, see Using Dynamic Labels.
ReturnData (boolean) –
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
.Period (integer) –
The granularity, in seconds, of the returned data points for this 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.If the
StartTime
parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
AccountId (string) –
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.
MetricThreshold (float) –
This value is the threshold that the observed metric values of the SLI metric are compared to.
ComparisonOperator (string) –
The arithmetic operation used when comparing the specified metric to the threshold.
Goal (dict) –
This structure contains the attributes that determine the goal of an SLO. This includes the time period for evaluation and the attainment threshold.
Interval (dict) –
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.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
RollingInterval
,CalendarInterval
. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBER
as the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBER
is as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
RollingInterval (dict) –
If the interval is a rolling interval, this structure contains the interval specifications.
DurationUnit (string) –
Specifies the rolling interval unit.
Duration (integer) –
Specifies the duration of each rolling interval. For example, if
Duration
is7
andDurationUnit
isDAY
, each rolling interval is seven days.
CalendarInterval (dict) –
If the interval is a calendar interval, this structure contains the interval specifications.
StartTime (datetime) –
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.
DurationUnit (string) –
Specifies the calendar interval unit.
Duration (integer) –
Specifies the duration of each calendar interval. For example, if
Duration
is1
andDurationUnit
isMONTH
, each interval is one month, aligned with the calendar.
AttainmentGoal (float) –
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.
WarningThreshold (float) –
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.
Errors (list) –
An array of structures, where each structure includes an error indicating that one of the requests in the array was not valid.
(dict) –
A structure containing information about one error that occurred during a BatchGetServiceLevelObjectiveBudgetReport operation.
Name (string) –
The name of the SLO that this error is related to.
Arn (string) –
The ARN of the SLO that this error is related to.
ErrorCode (string) –
The error code for this error.
ErrorMessage (string) –
The message for this error.
Exceptions