Show / Hide Table of Contents

Class MetricProps

Properties for a metric.

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

ExampleMetadata: infused

Examples
var hostedZone = new HostedZone(this, "MyHostedZone", new HostedZoneProps { ZoneName = "example.org" });
var metric = new Metric(new MetricProps {
    Namespace = "AWS/Route53",
    MetricName = "DNSQueries",
    DimensionsMap = new Dictionary<string, string> {
        { "HostedZoneId", hostedZone.HostedZoneId }
    }
});

Synopsis

Constructors

MetricProps()

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.

MetricName

Name of the metric.

Namespace

Namespace of the metric.

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

MetricProps()

public MetricProps()

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

MetricName

Name of the metric.

public string MetricName { get; set; }
Property Value

System.String

Namespace

Namespace of the metric.

public string Namespace { get; set; }
Property Value

System.String

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

    IMetricProps
    ICommonMetricOptions
    Back to top Generated by DocFX