Class CfnAppMonitor.MetricDefinitionProperty.Builder
java.lang.Object
software.amazon.awscdk.services.rum.CfnAppMonitor.MetricDefinitionProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnAppMonitor.MetricDefinitionProperty>
- Enclosing interface:
CfnAppMonitor.MetricDefinitionProperty
@Stability(Stable)
public static final class CfnAppMonitor.MetricDefinitionProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnAppMonitor.MetricDefinitionProperty>
A builder for
CfnAppMonitor.MetricDefinitionProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.dimensionKeys
(Map<String, String> dimensionKeys) Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getDimensionKeys()
dimensionKeys
(IResolvable dimensionKeys) Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getDimensionKeys()
eventPattern
(String eventPattern) Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getEventPattern()
Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getName()
Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getNamespace()
Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getUnitLabel()
Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getValueKey()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getName()
- Parameters:
name
- The name of the metric that is defined in this structure. This parameter is required.- Returns:
this
-
dimensionKeys
@Stability(Stable) public CfnAppMonitor.MetricDefinitionProperty.Builder dimensionKeys(IResolvable dimensionKeys) Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getDimensionKeys()
- Parameters:
dimensionKeys
- This field is a map of field paths to dimension names. It defines the dimensions to associate with this metric in CloudWatch . The value of this field is used only if the metric destination isCloudWatch
. If the metric destination isEvidently
, the value ofDimensionKeys
is ignored.- Returns:
this
-
dimensionKeys
@Stability(Stable) public CfnAppMonitor.MetricDefinitionProperty.Builder dimensionKeys(Map<String, String> dimensionKeys) Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getDimensionKeys()
- Parameters:
dimensionKeys
- This field is a map of field paths to dimension names. It defines the dimensions to associate with this metric in CloudWatch . The value of this field is used only if the metric destination isCloudWatch
. If the metric destination isEvidently
, the value ofDimensionKeys
is ignored.- Returns:
this
-
eventPattern
@Stability(Stable) public CfnAppMonitor.MetricDefinitionProperty.Builder eventPattern(String eventPattern) Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getEventPattern()
- Parameters:
eventPattern
- The pattern that defines the metric. RUM checks events that happen in a user's session against the pattern, and events that match the pattern are sent to the metric destination.If the metrics destination is
CloudWatch
and the event also matches a value inDimensionKeys
, then the metric is published with the specified dimensions.- Returns:
this
-
namespace
@Stability(Stable) public CfnAppMonitor.MetricDefinitionProperty.Builder namespace(String namespace) Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getNamespace()
- Parameters:
namespace
- If you are creating a custom metric instead of an extended metrics, use this parameter to define the metric namespace for that custom metric. Do not specify this parameter if you are creating an extended metric.You can't use any string that starts with
AWS/
for your namespace.- Returns:
this
-
unitLabel
@Stability(Stable) public CfnAppMonitor.MetricDefinitionProperty.Builder unitLabel(String unitLabel) Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getUnitLabel()
- Parameters:
unitLabel
- Use this field only if you are sending this metric to CloudWatch . It defines the CloudWatch metric unit that this metric is measured in.- Returns:
this
-
valueKey
Sets the value ofCfnAppMonitor.MetricDefinitionProperty.getValueKey()
- Parameters:
valueKey
- The field within the event object that the metric value is sourced from.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnAppMonitor.MetricDefinitionProperty>
- Returns:
- a new instance of
CfnAppMonitor.MetricDefinitionProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-