interface MetricConfig
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CloudWatch.MetricConfig |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#MetricConfig |
Java | software.amazon.awscdk.services.cloudwatch.MetricConfig |
Python | aws_cdk.aws_cloudwatch.MetricConfig |
TypeScript (source) | aws-cdk-lib » aws_cloudwatch » MetricConfig |
Obtainable from
Math
.toMetricConfig()
, Metric
.toMetricConfig()
Properties of a rendered metric.
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 metric: cloudwatch.Metric;
declare const renderingProperties: any;
declare const value: any;
const metricConfig: cloudwatch.MetricConfig = {
mathExpression: {
expression: 'expression',
period: 123,
usingMetrics: {
usingMetricsKey: metric,
},
// the properties below are optional
searchAccount: 'searchAccount',
searchRegion: 'searchRegion',
},
metricStat: {
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,
},
renderingProperties: {
renderingPropertiesKey: renderingProperties,
},
};
Properties
Name | Type | Description |
---|---|---|
math | Metric | In case the metric is a math expression, the details of the math expression. |
metric | Metric | In case the metric represents a query, the details of the query. |
rendering | { [string]: any } | Additional properties which will be rendered if the metric is used in a dashboard. |
mathExpression?
Type:
Metric
(optional, default: None)
In case the metric is a math expression, the details of the math expression.
metricStat?
Type:
Metric
(optional, default: None)
In case the metric represents a query, the details of the query.
renderingProperties?
Type:
{ [string]: any }
(optional, default: None)
Additional properties which will be rendered if the metric is used in a dashboard.
Examples are 'label' and 'color', but any key in here will be added to dashboard graphs.