Interface MetricFilterOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
MetricFilterProps
- All Known Implementing Classes:
MetricFilterOptions.Jsii$Proxy,MetricFilterProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-06T23:25:12.521Z")
@Stability(Stable)
public interface MetricFilterOptions
extends software.amazon.jsii.JsiiSerializable
Properties for a MetricFilter created from a LogGroup.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudwatch.*;
import software.amazon.awscdk.services.logs.*;
IFilterPattern filterPattern;
MetricFilterOptions metricFilterOptions = MetricFilterOptions.builder()
.filterPattern(filterPattern)
.metricName("metricName")
.metricNamespace("metricNamespace")
// the properties below are optional
.defaultValue(123)
.dimensions(Map.of(
"dimensionsKey", "dimensions"))
.filterName("filterName")
.metricValue("metricValue")
.unit(Unit.SECONDS)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forMetricFilterOptionsstatic final classAn implementation forMetricFilterOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic MetricFilterOptions.Builderbuilder()default NumberThe value to emit if the pattern does not match a particular event.The fields to use as dimensions for the metric.default StringThe name of the metric filter.Pattern to search for log events.The name of the metric to emit.The namespace of the metric to emit.default StringThe value to emit for the metric.default UnitgetUnit()The unit to assign to the metric.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getFilterPattern
Pattern to search for log events. -
getMetricName
The name of the metric to emit. -
getMetricNamespace
The namespace of the metric to emit. -
getDefaultValue
The value to emit if the pattern does not match a particular event.Default: No metric emitted.
-
getDimensions
The fields to use as dimensions for the metric.One metric filter can include as many as three dimensions.
Default: - No dimensions attached to metrics.
- See Also:
-
getFilterName
The name of the metric filter.Default: - Cloudformation generated name.
-
getMetricValue
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'.
Default: "1"
-
getUnit
The unit to assign to the metric.Default: - No unit attached to metrics.
- See Also:
-
builder
- Returns:
- a
MetricFilterOptions.BuilderofMetricFilterOptions
-