MetricStatConfig Struct
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
ts
// 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
accountoptionalstringaccountoptionalstraccountoptionalStringAccountoptionalstringAccountoptional*string#Account which this metric comes from.
Default: Deployment account.
accountOverrideoptionalstringaccount_overrideoptionalstraccountOverrideoptionalStringAccountOverrideoptionalstringAccountOverrideoptional*string#Account set directly on the metric, not inherited from the attached stack.
Default: No override.
dimensionsoptionalDimension[]dimensionsoptionaltyping.List[Dimension]dimensionsoptionalList<Dimension>DimensionsoptionalDimension[]Dimensionsoptional*[]Dimension= []#The dimensions to apply to the alarm.
Name of the metric.
Namespace of the metric.
How many seconds to aggregate over.
Region which this metric comes from.
Default: Deployment region.
regionOverrideoptionalstringregion_overrideoptionalstrregionOverrideoptionalStringRegionOverrideoptionalstringRegionOverrideoptional*string#Region set directly on the metric, not inherited from the attached stack.
Default: No override.
Aggregation function to use (can be either simple or a percentile).
unitFilteroptionalUnitunit_filteroptionalUnitunitFilteroptionalUnitUnitFilteroptionalUnitUnitFilteroptionalUnit#Unit used to filter the metric stream.
Default: Refer to all metric datums
notes
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.