Interface IMetricProps
Properties for a metric.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudWatch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IMetricProps : ICommonMetricOptions
Syntax (vb)
Public Interface IMetricProps
Inherits ICommonMetricOptions
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CloudWatch;
var metric = new Metric(new MetricProps {
Namespace = "MyNamespace",
MetricName = "MyMetric",
DimensionsMap = new Dictionary<string, string> { { "MyDimension", "MyDimensionValue" } }
});
var alarm = new Alarm(this, "MyAlarm", new AlarmProps {
Metric = metric,
Threshold = 100,
EvaluationPeriods = 3,
DatapointsToAlarm = 2
});
var topicRule = new TopicRule(this, "TopicRule", new TopicRuleProps {
Sql = IotSql.FromStringAsVer20160323("SELECT topic(2) as device_id FROM 'device/+/data'"),
Actions = new [] {
new CloudWatchSetAlarmStateAction(alarm, new CloudWatchSetAlarmStateActionProps {
Reason = "AWS Iot Rule action is triggered",
AlarmStateToSet = AlarmState.ALARM
}) }
});
Synopsis
Properties
MetricName | Name of the metric. |
Namespace | Namespace of the metric. |
Properties
MetricName
Name of the metric.
string MetricName { get; }
Property Value
System.String
Namespace
Namespace of the metric.
string Namespace { get; }
Property Value
System.String