MDAA TS Docs
    Preparing search index...

    Properties for a metric in a dashboard widget.

    Use cases: CloudWatch metric display; Metric math expressions; SSM-referenced metrics

    AWS: CloudWatch metric data queries for dashboard visualization

    Validation: For regular metrics namespace and metricName are required; for metric math expression is required

    interface DashboardMetricProps {
        dimensions?: { [key: string]: string };
        expression?: string;
        id?: string;
        label?: string;
        metricName?: string;
        namespace?: string;
        period?: number;
        stat?: string;
        unit?: string;
    }
    Index

    Properties

    dimensions?: { [key: string]: string }

    Dimensions for the metric.

    - No dimensions
    
    expression?: string

    Metric math expression for calculations across metrics. Example: "m1+m2+m3" to sum multiple metrics. When using expressions, other metrics must have 'id' property set.

    - Not used for regular metrics
    
    id?: string

    ID for the metric (used in expressions)

    - Auto-generated
    
    label?: string

    Label for the metric

    - Metric name or expression
    
    metricName?: string

    Metric name. Required for regular metrics, optional for metric math expressions. Can be a direct value or SSM reference with ssm: prefix. Examples:

    • Direct: "Errors"
    • SSM: "ssm:/{{org}}/{{domain}}/module/metric/name"
    - Required unless using expression
    
    namespace?: string

    Metric namespace. Required for regular metrics, optional for metric math expressions. Can be a direct value or SSM reference with ssm: prefix. Examples:

    • Direct: "AWS/Lambda"
    • SSM: "ssm:/{{org}}/{{domain}}/module/metric/namespace"
    - Required unless using expression
    
    period?: number

    Period for the metric in seconds

    300
    
    stat?: string

    Statistic to apply to the metric

    'Average'
    
    unit?: string

    Unit of the metric

    - No unit