interface MetricStatConfig
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudWatch.MetricStatConfig |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#MetricStatConfig |
![]() | software.amazon.awscdk.services.cloudwatch.MetricStatConfig |
![]() | aws_cdk.aws_cloudwatch.MetricStatConfig |
![]() | 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',
accountOverride: 'accountOverride',
dimensions: [{
name: 'name',
value: value,
}],
region: 'region',
regionOverride: 'regionOverride',
unitFilter: cloudwatch.Unit.SECONDS,
};
Properties
Name | Type | Description |
---|---|---|
metric | string | Name of the metric. |
namespace | string | Namespace of the metric. |
period | Duration | How many seconds to aggregate over. |
statistic | string | Aggregation function to use (can be either simple or a percentile). |
account? | string | Account which this metric comes from. |
account | string | Account set directly on the metric, not inherited from the attached stack. |
dimensions? | Dimension [] | The dimensions to apply to the alarm. |
region? | string | Region which this metric comes from. |
region | string | Region set directly on the metric, not inherited from the attached stack. |
unit | Unit | Unit 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.
accountOverride?
Type:
string
(optional, default: No override.)
Account set directly on the metric, not inherited from the attached stack.
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.
regionOverride?
Type:
string
(optional, default: No override.)
Region set directly on the metric, not inherited from the attached stack.
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.