Show / Hide Table of Contents

Class MetricOptions

Properties of a metric that can be changed.

Inheritance
System.Object
MetricOptions
Implements
IMetricOptions
ICommonMetricOptions
Namespace: Amazon.CDK.AWS.CloudWatch
Assembly: Amazon.CDK.AWS.CloudWatch.dll
Syntax (csharp)
public class MetricOptions : Object, IMetricOptions, ICommonMetricOptions
Syntax (vb)
Public Class MetricOptions
    Inherits Object
    Implements IMetricOptions, ICommonMetricOptions
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.CloudWatch;
DeliveryStream deliveryStream;


// Alarm that triggers when the per-second average of incoming bytes exceeds 90% of the current service limit
MathExpression incomingBytesPercentOfLimit = new MathExpression(new MathExpressionProps {
    Expression = "incomingBytes / 300 / bytePerSecLimit",
    UsingMetrics = new Dictionary<string, IMetric> {
        { "incomingBytes", deliveryStream.MetricIncomingBytes(new MetricOptions { Statistic = Statistic.SUM }) },
        { "bytePerSecLimit", deliveryStream.Metric("BytesPerSecondLimit") }
    }
});

new Alarm(this, "Alarm", new AlarmProps {
    Metric = incomingBytesPercentOfLimit,
    Threshold = 0.9,
    EvaluationPeriods = 3
});

Synopsis

Constructors

MetricOptions()

Properties

Account

Account which this metric comes from.

Color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.

Dimensions

(deprecated) Dimensions of the metric.

DimensionsMap

Dimensions of the metric.

Label

Label for this metric when added to a Graph in a Dashboard.

Period

The period over which the specified statistic is applied.

Region

Region which this metric comes from.

Statistic

What function to use for aggregating.

Unit

Unit used to filter the metric stream.

Constructors

MetricOptions()

public MetricOptions()

Properties

Account

Account which this metric comes from.

public string Account { get; set; }
Property Value

System.String

Remarks

Default: - Deployment account.

Color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.

public string Color { get; set; }
Property Value

System.String

Remarks

Default: - Automatic color

Dimensions

(deprecated) Dimensions of the metric.

public IDictionary<string, object> Dimensions { get; set; }
Property Value

System.Collections.Generic.IDictionary<System.String, System.Object>

Remarks

Default: - No dimensions.

Stability: Deprecated

DimensionsMap

Dimensions of the metric.

public IDictionary<string, string> DimensionsMap { get; set; }
Property Value

System.Collections.Generic.IDictionary<System.String, System.String>

Remarks

Default: - No dimensions.

Label

Label for this metric when added to a Graph in a Dashboard.

public string Label { get; set; }
Property Value

System.String

Remarks

You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

[max: ${MAX}] MyMetric

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.

Default: - No label

Period

The period over which the specified statistic is applied.

public Duration Period { get; set; }
Property Value

Duration

Remarks

Default: Duration.minutes(5)

Region

Region which this metric comes from.

public string Region { get; set; }
Property Value

System.String

Remarks

Default: - Deployment region.

Statistic

What function to use for aggregating.

public string Statistic { get; set; }
Property Value

System.String

Remarks

Can be one of the following:

    Default: Average

    Unit

    Unit used to filter the metric stream.

    public Nullable<Unit> Unit { get; set; }
    Property Value

    System.Nullable<Unit>

    Remarks

    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.

    The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

    CloudWatch does not honor this property for graphs.

    Default: - All metric datums in the given metric stream

    Implements

    IMetricOptions
    ICommonMetricOptions
    Back to top Generated by DocFX