MetricProps

class aws_cdk.aws_cloudwatch.MetricProps(*, account=None, color=None, dimensions=None, label=None, period=None, region=None, statistic=None, unit=None, metric_name, namespace)

Bases: aws_cdk.aws_cloudwatch.CommonMetricOptions

__init__(*, account=None, color=None, dimensions=None, label=None, period=None, region=None, statistic=None, unit=None, metric_name, namespace)

Properties for a metric.

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

  • color (Optional[str]) – Color for this metric when added to a Graph in a Dashboard.

  • dimensions (Optional[Mapping[str, Any]]) – Dimensions of the metric. Default: - No dimensions.

  • label (Optional[str]) – Label for this metric when added to a Graph in a Dashboard.

  • period (Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)

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

  • statistic (Optional[str]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Average

  • unit (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. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: All metric datums in the given metric stream

  • metric_name (str) – Name of the metric.

  • namespace (str) – Namespace of the metric.

Attributes

account

Account which this metric comes from.

default :default: Deployment account.

Return type

Optional[str]

color

Color for this metric when added to a Graph in a Dashboard.

Return type

Optional[str]

dimensions

Dimensions of the metric.

default :default: - No dimensions.

Return type

Optional[Mapping[str, Any]]

label

Label for this metric when added to a Graph in a Dashboard.

Return type

Optional[str]

metric_name

Name of the metric.

Return type

str

namespace

Namespace of the metric.

Return type

str

period

The period over which the specified statistic is applied.

default :default: Duration.minutes(5)

Return type

Optional[Duration]

region

Region which this metric comes from.

default :default: Deployment region.

Return type

Optional[str]

statistic

What function to use for aggregating.

Can be one of the following:

  • “Minimum” | “min”

  • “Maximum” | “max”

  • “Average” | “avg”

  • “Sum” | “sum”

  • “SampleCount | “n”

  • “pNN.NN”

default :default: Average

Return type

Optional[str]

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.

The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

CloudWatch does not honor this property for graphs.

default :default: All metric datums in the given metric stream

Return type

Optional[Unit]