Class MetricFilterOptions.Builder
java.lang.Object
software.amazon.awscdk.services.logs.MetricFilterOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<MetricFilterOptions>
- Enclosing interface:
MetricFilterOptions
@Stability(Stable)
public static final class MetricFilterOptions.Builder
extends Object
implements software.amazon.jsii.Builder<MetricFilterOptions>
A builder for
MetricFilterOptions-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.defaultValue(Number defaultValue) Sets the value ofMetricFilterOptions.getDefaultValue()dimensions(Map<String, String> dimensions) Sets the value ofMetricFilterOptions.getDimensions()filterName(String filterName) Sets the value ofMetricFilterOptions.getFilterName()filterPattern(IFilterPattern filterPattern) Sets the value ofMetricFilterOptions.getFilterPattern()metricName(String metricName) Sets the value ofMetricFilterOptions.getMetricName()metricNamespace(String metricNamespace) Sets the value ofMetricFilterOptions.getMetricNamespace()metricValue(String metricValue) Sets the value ofMetricFilterOptions.getMetricValue()Sets the value ofMetricFilterOptions.getUnit()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
filterPattern
Sets the value ofMetricFilterOptions.getFilterPattern()- Parameters:
filterPattern- Pattern to search for log events. This parameter is required.- Returns:
this
-
metricName
Sets the value ofMetricFilterOptions.getMetricName()- Parameters:
metricName- The name of the metric to emit. This parameter is required.- Returns:
this
-
metricNamespace
Sets the value ofMetricFilterOptions.getMetricNamespace()- Parameters:
metricNamespace- The namespace of the metric to emit. This parameter is required.- Returns:
this
-
defaultValue
Sets the value ofMetricFilterOptions.getDefaultValue()- Parameters:
defaultValue- The value to emit if the pattern does not match a particular event.- Returns:
this
-
dimensions
Sets the value ofMetricFilterOptions.getDimensions()- Parameters:
dimensions- The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions.- Returns:
this
-
filterName
Sets the value ofMetricFilterOptions.getFilterName()- Parameters:
filterName- The name of the metric filter.- Returns:
this
-
metricValue
Sets the value ofMetricFilterOptions.getMetricValue()- Parameters:
metricValue- The value to emit for the metric. Can either be a literal number (typically "1"), or the name of a field in the structure to take the value from the matched event. If you are using a field value, the field value must have been matched using the pattern.If you want to specify a field from a matched JSON structure, use '$.fieldName', and make sure the field is in the pattern (if only as '$.fieldName = *').
If you want to specify a field from a matched space-delimited structure, use '$fieldName'.
- Returns:
this
-
unit
Sets the value ofMetricFilterOptions.getUnit()- Parameters:
unit- The unit to assign to the metric.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<MetricFilterOptions>- Returns:
- a new instance of
MetricFilterOptions - Throws:
NullPointerException- if any required attribute was not provided
-