Interface ICommonMetricOptions
Options shared by most methods accepting metric options.
Namespace: Amazon.CDK.AWS.CloudWatch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ICommonMetricOptions
Syntax (vb)
Public Interface ICommonMetricOptions
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.CloudWatch;
var commonMetricOptions = new CommonMetricOptions {
Account = "account",
Color = "color",
DimensionsMap = new Dictionary<string, string> {
{ "dimensionsMapKey", "dimensionsMap" }
},
Id = "id",
Label = "label",
Period = Duration.Minutes(30),
Region = "region",
StackAccount = "stackAccount",
StackRegion = "stackRegion",
Statistic = "statistic",
Unit = Unit.SECONDS,
Visible = false
};
Synopsis
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 |
| DimensionsMap | Dimensions of the metric. |
| Id | Unique identifier for this metric when used in dashboard widgets. |
| 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. |
| StackAccount | Account of the stack this metric is attached to. |
| StackRegion | Region of the stack this metric is attached to. |
| Statistic | What function to use for aggregating. |
| Unit | Unit used to filter the metric stream. |
| Visible | Whether this metric should be visible in dashboard graphs. |
Properties
Account
Account which this metric comes from.
string? Account { get; }
Property Value
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.
string? Color { get; }
Property Value
Remarks
Default: - Automatic color
DimensionsMap
Dimensions of the metric.
IDictionary<string, string>? DimensionsMap { get; }
Property Value
Remarks
Default: - No dimensions.
Id
Unique identifier for this metric when used in dashboard widgets.
string? Id { get; }
Property Value
Remarks
The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.
Default: - No ID
Label
Label for this metric when added to a Graph in a Dashboard.
string? Label { get; }
Property Value
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.
Duration? Period { get; }
Property Value
Remarks
Default: Duration.minutes(5)
Region
Region which this metric comes from.
string? Region { get; }
Property Value
Remarks
Default: - Deployment region.
StackAccount
Account of the stack this metric is attached to.
string? StackAccount { get; }
Property Value
Remarks
Default: - Deployment account.
StackRegion
Region of the stack this metric is attached to.
string? StackRegion { get; }
Property Value
Remarks
Default: - Deployment region.
Statistic
What function to use for aggregating.
string? Statistic { get; }
Property Value
Remarks
Use the aws_cloudwatch.Stats helper class to construct valid input strings.
Can be one of the following:
Default: Average
Unit
Unit used to filter the metric stream.
Unit? Unit { get; }
Property Value
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
Visible
Whether this metric should be visible in dashboard graphs.
bool? Visible { get; }
Property Value
bool?
Remarks
Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results.
Default: true