Class CfnMetricFilterPropsMixin.MetricTransformationProperty
MetricTransformation is a property of the AWS::Logs::MetricFilter resource that describes how to transform log streams into a CloudWatch metric.
Inherited Members
Namespace: Amazon.CDK.CfnPropertyMixins.AWS.Logs
Assembly: Amazon.CDK.CfnPropertyMixins.dll
Syntax (csharp)
public class CfnMetricFilterPropsMixin.MetricTransformationProperty : CfnMetricFilterPropsMixin.IMetricTransformationProperty
Syntax (vb)
Public Class CfnMetricFilterPropsMixin.MetricTransformationProperty Implements CfnMetricFilterPropsMixin.IMetricTransformationProperty
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.CfnPropertyMixins.AWS.Logs;
var metricTransformationProperty = new MetricTransformationProperty {
DefaultValue = 123,
Dimensions = new [] { new DimensionProperty {
Key = "key",
Value = "value"
} },
MetricName = "metricName",
MetricNamespace = "metricNamespace",
MetricValue = "metricValue",
Unit = "unit"
};
Synopsis
Constructors
| MetricTransformationProperty() |
|
Properties
| DefaultValue | (Optional) The value to emit when a filter pattern does not match a log event. |
| Dimensions | The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions. |
| MetricName | The name of the CloudWatch metric. |
| MetricNamespace | A custom namespace to contain your metric in CloudWatch. |
| MetricValue | The value that is published to the CloudWatch metric. |
| Unit | The unit to assign to the metric. |
Constructors
MetricTransformationProperty()
MetricTransformation is a property of the AWS::Logs::MetricFilter resource that describes how to transform log streams into a CloudWatch metric.
public MetricTransformationProperty()
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.CfnPropertyMixins.AWS.Logs;
var metricTransformationProperty = new MetricTransformationProperty {
DefaultValue = 123,
Dimensions = new [] { new DimensionProperty {
Key = "key",
Value = "value"
} },
MetricName = "metricName",
MetricNamespace = "metricNamespace",
MetricValue = "metricValue",
Unit = "unit"
};
Properties
DefaultValue
(Optional) The value to emit when a filter pattern does not match a log event.
public double? DefaultValue { get; set; }
Property Value
Remarks
Dimensions
The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions.
public object? Dimensions { get; set; }
Property Value
Remarks
Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as <code>IPAddress</code> or <code>requestID</code> as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric.
CloudWatch Logs disables a metric filter if it generates 1000 different name/value pairs for your specified dimensions within a certain amount of time. This helps to prevent accidental high charges.
You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated AWS Charges .
Type union: either IResolvable or (either IResolvable or CfnMetricFilterPropsMixin.IDimensionProperty)[]
MetricName
The name of the CloudWatch metric.
public string? MetricName { get; set; }
Property Value
Remarks
MetricNamespace
A custom namespace to contain your metric in CloudWatch.
public string? MetricNamespace { get; set; }
Property Value
Remarks
Use namespaces to group together metrics that are similar. For more information, see Namespaces .
MetricValue
The value that is published to the CloudWatch metric.
public string? MetricValue { get; set; }
Property Value
Remarks
For example, if you're counting the occurrences of a particular term like Error , specify 1 for the metric value. If you're counting the number of bytes transferred, reference the value that is in the log event by using \(. followed by the name of the field that you specified in the filter pattern, such as <code>\).size .
Unit
The unit to assign to the metric.
public string? Unit { get; set; }
Property Value
Remarks
If you omit this, the unit is set as None .