Skip to content
v2.274.0

MetricConfig Struct ​

Properties of a rendered metric.

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 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',
    accountOverride: 'accountOverride',
    dimensions: [{
      name: 'name',
      value: value,
    }],
    region: 'region',
    regionOverride: 'regionOverride',
    unitFilter: cloudwatch.Unit.SECONDS,
  },
  renderingProperties: {
    renderingPropertiesKey: renderingProperties,
  },
  searchExpression: {
    expression: 'expression',
    period: 123,
    usingMetrics: {
      usingMetricsKey: metric,
    },

    // the properties below are optional
    searchAccount: 'searchAccount',
    searchRegion: 'searchRegion',
  },
};

Properties ​

mathExpressionMetricExpressionConfigmath_expressionMetricExpressionConfigmathExpressionMetricExpressionConfigMathExpressionMetricExpressionConfigMathExpressionMetricExpressionConfig= None#
In case the metric is a math expression, the details of the math expression.
metricStatMetricStatConfigmetric_statMetricStatConfigmetricStatMetricStatConfigMetricStatMetricStatConfigMetricStatMetricStatConfig= None#
In case the metric represents a query, the details of the query.
renderingProperties{ [key: string]: any }rendering_propertiestyping.Mapping[str, Any]renderingPropertiesMap<String, Object>RenderingPropertiesIDictionary<string, object>RenderingProperties*map[string]interface{}= 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.

searchExpressionMetricExpressionConfigsearch_expressionMetricExpressionConfigsearchExpressionMetricExpressionConfigSearchExpressionMetricExpressionConfigSearchExpressionMetricExpressionConfig= None#
In case the metric is a search expression, the details of the search expression.