aws-cdk-lib.aws_cloudwatch.MetricStatConfig

interface MetricStatConfig

LanguageType name
.NETAmazon.CDK.AWS.CloudWatch.MetricStatConfig
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#MetricStatConfig
Javasoftware.amazon.awscdk.services.cloudwatch.MetricStatConfig
Pythonaws_cdk.aws_cloudwatch.MetricStatConfig
TypeScript (source)aws-cdk-lib » aws_cloudwatch » MetricStatConfig

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.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';

declare const value: any;
const metricStatConfig: cloudwatch.MetricStatConfig = {
  metricName: 'metricName',
  namespace: 'namespace',
  period: cdk.Duration.minutes(30),
  statistic: 'statistic',

  // the properties below are optional
  account: 'account',
  dimensions: [{
    name: 'name',
    value: value,
  }],
  region: 'region',
  unitFilter: cloudwatch.Unit.SECONDS,
};

Properties

NameTypeDescription
metricNamestringName of the metric.
namespacestringNamespace of the metric.
periodDurationHow many seconds to aggregate over.
statisticstringAggregation function to use (can be either simple or a percentile).
account?stringAccount which this metric comes from.
dimensions?Dimension[]The dimensions to apply to the alarm.
region?stringRegion which this metric comes from.
unitFilter?UnitUnit used to filter the metric stream.

metricName

Type: string

Name of the metric.


namespace

Type: string

Namespace of the metric.


period

Type: Duration

How many seconds to aggregate over.


statistic

Type: string

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


account?

Type: string (optional, default: Deployment account.)

Account which this metric comes from.


dimensions?

Type: Dimension[] (optional, default: [])

The dimensions to apply to the alarm.


region?

Type: string (optional, default: Deployment region.)

Region which this metric comes from.


unitFilter?

Type: Unit (optional, default: Refer to all metric datums)

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.