Class CfnMetricFilter.MetricTransformationProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnMetricFilter.MetricTransformationProperty>
- Enclosing interface:
CfnMetricFilter.MetricTransformationProperty
CfnMetricFilter.MetricTransformationProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.defaultValue
(Number defaultValue) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getDefaultValue()
dimensions
(List<? extends Object> dimensions) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getDimensions()
dimensions
(IResolvable dimensions) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getDimensions()
metricName
(String metricName) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getMetricName()
metricNamespace
(String metricNamespace) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getMetricNamespace()
metricValue
(String metricValue) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getMetricValue()
Sets the value ofCfnMetricFilter.MetricTransformationProperty.getUnit()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
metricName
@Stability(Stable) public CfnMetricFilter.MetricTransformationProperty.Builder metricName(String metricName) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getMetricName()
- Parameters:
metricName
- The name of the CloudWatch metric. This parameter is required.- Returns:
this
-
metricNamespace
@Stability(Stable) public CfnMetricFilter.MetricTransformationProperty.Builder metricNamespace(String metricNamespace) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getMetricNamespace()
- Parameters:
metricNamespace
- A custom namespace to contain your metric in CloudWatch. This parameter is required. Use namespaces to group together metrics that are similar. For more information, see Namespaces .- Returns:
this
-
metricValue
@Stability(Stable) public CfnMetricFilter.MetricTransformationProperty.Builder metricValue(String metricValue) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getMetricValue()
- Parameters:
metricValue
- The value that is published to the CloudWatch metric. This parameter is required. For example, if you're counting the occurrences of a particular term likeError
, 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$.size
.- Returns:
this
-
defaultValue
@Stability(Stable) public CfnMetricFilter.MetricTransformationProperty.Builder defaultValue(Number defaultValue) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getDefaultValue()
- Parameters:
defaultValue
- (Optional) The value to emit when a filter pattern does not match a log event. This value can be null.- Returns:
this
-
dimensions
@Stability(Stable) public CfnMetricFilter.MetricTransformationProperty.Builder dimensions(IResolvable dimensions) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getDimensions()
- Parameters:
dimensions
- The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions.Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as
IPAddress
orrequestID
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 .
- Returns:
this
-
dimensions
@Stability(Stable) public CfnMetricFilter.MetricTransformationProperty.Builder dimensions(List<? extends Object> dimensions) Sets the value ofCfnMetricFilter.MetricTransformationProperty.getDimensions()
- Parameters:
dimensions
- The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions.Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as
IPAddress
orrequestID
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 .
- Returns:
this
-
unit
Sets the value ofCfnMetricFilter.MetricTransformationProperty.getUnit()
- Parameters:
unit
- The unit to assign to the metric. If you omit this, the unit is set asNone
.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnMetricFilter.MetricTransformationProperty>
- Returns:
- a new instance of
CfnMetricFilter.MetricTransformationProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-