MetricStatConfig

class aws_cdk.aws_cloudwatch.MetricStatConfig(*, account=None, dimensions=None, metric_name, namespace, period, region=None, statistic, unit_filter=None)

Bases: object

Properties for a concrete metric.

NOTE: unit is no longer on this object since it is only used for Alarms, and doesn’t mean what one would expect it to mean there anyway. It is most likely to be misused.

Parameters
  • account (Optional[str]) – Account which this metric comes from. Default: Deployment account.

  • dimensions (Optional[Sequence[Dimension]]) – The dimensions to apply to the alarm. Default: []

  • metric_name (str) – Name of the metric.

  • namespace (str) – Namespace of the metric.

  • period (Duration) – How many seconds to aggregate over.

  • region (Optional[str]) – Region which this metric comes from. Default: Deployment region.

  • statistic (str) – Aggregation function to use (can be either simple or a percentile).

  • 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 plain unit to clearly communicate its purpose. Default: - Refer to all metric datums

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_cloudwatch as cloudwatch
import aws_cdk.core as cdk

# value is of type object

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.

Return type

Optional[str]

dimensions

The dimensions to apply to the alarm.

Default

[]

Return type

Optional[List[Dimension]]

metric_name

Name of the metric.

Return type

str

namespace

Namespace of the metric.

Return type

str

period

How many seconds to aggregate over.

Return type

Duration

region

Region which this metric comes from.

Default

Deployment region.

Return type

Optional[str]

statistic

Aggregation function to use (can be either simple or a percentile).

Return type

str

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

Return type

Optional[Unit]