MetricStatConfig
- class aws_cdk.aws_cloudwatch.MetricStatConfig(*, metric_name, namespace, period, statistic, account=None, dimensions=None, region=None, unit_filter=None)
Bases:
object
Properties for a concrete metric.
NOTE:
unit
is no longer on this object since it is only used forAlarms
, and doesn’t mean what one would expect it to mean there anyway. It is most likely to be misused.- Parameters:
metric_name (
str
) – Name of the metric.namespace (
str
) – Namespace of the metric.period (
Duration
) – How many seconds to aggregate over.statistic (
str
) – Aggregation function to use (can be either simple or a percentile).account (
Optional
[str
]) – Account which this metric comes from. Default: Deployment account.dimensions (
Optional
[Sequence
[Union
[Dimension
,Dict
[str
,Any
]]]]) – The dimensions to apply to the alarm. Default: []region (
Optional
[str
]) – Region which this metric comes from. Default: Deployment region.unit_filter (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. This field has been renamed from plainunit
to clearly communicate its purpose. Default: - Refer to all metric datums
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk as cdk from aws_cdk import aws_cloudwatch as cloudwatch # value: Any metric_stat_config = cloudwatch.MetricStatConfig( metric_name="metricName", namespace="namespace", period=cdk.Duration.minutes(30), statistic="statistic", # the properties below are optional account="account", dimensions=[cloudwatch.Dimension( name="name", value=value )], region="region", unit_filter=cloudwatch.Unit.SECONDS )
Attributes
- account
Account which this metric comes from.
- Default:
Deployment account.
- dimensions
The dimensions to apply to the alarm.
- Default:
[]
- metric_name
Name of the metric.
- namespace
Namespace of the metric.
- period
How many seconds to aggregate over.
- region
Region which this metric comes from.
- Default:
Deployment region.
- statistic
Aggregation function to use (can be either simple or a percentile).
- unit_filter
Unit used to filter the metric stream.
Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.
This field has been renamed from plain
unit
to clearly communicate its purpose.- Default:
Refer to all metric datums