Struct aws_sdk_rum::types::builders::MetricDefinitionRequestBuilder
source · #[non_exhaustive]pub struct MetricDefinitionRequestBuilder { /* private fields */ }
Expand description
A builder for MetricDefinitionRequest
.
Implementations§
source§impl MetricDefinitionRequestBuilder
impl MetricDefinitionRequestBuilder
sourcepub fn name(self, input: impl Into<String>) -> Self
pub fn name(self, input: impl Into<String>) -> Self
The name for the metric that is defined in this structure. For custom metrics, you can specify any name that you like. For extended metrics, valid values are the following:
-
PerformanceNavigationDuration
-
PerformanceResourceDuration
-
NavigationSatisfiedTransaction
-
NavigationToleratedTransaction
-
NavigationFrustratedTransaction
-
WebVitalsCumulativeLayoutShift
-
WebVitalsFirstInputDelay
-
WebVitalsLargestContentfulPaint
-
JsErrorCount
-
HttpErrorCount
-
SessionCount
sourcepub fn set_name(self, input: Option<String>) -> Self
pub fn set_name(self, input: Option<String>) -> Self
The name for the metric that is defined in this structure. For custom metrics, you can specify any name that you like. For extended metrics, valid values are the following:
-
PerformanceNavigationDuration
-
PerformanceResourceDuration
-
NavigationSatisfiedTransaction
-
NavigationToleratedTransaction
-
NavigationFrustratedTransaction
-
WebVitalsCumulativeLayoutShift
-
WebVitalsFirstInputDelay
-
WebVitalsLargestContentfulPaint
-
JsErrorCount
-
HttpErrorCount
-
SessionCount
sourcepub fn get_name(&self) -> &Option<String>
pub fn get_name(&self) -> &Option<String>
The name for the metric that is defined in this structure. For custom metrics, you can specify any name that you like. For extended metrics, valid values are the following:
-
PerformanceNavigationDuration
-
PerformanceResourceDuration
-
NavigationSatisfiedTransaction
-
NavigationToleratedTransaction
-
NavigationFrustratedTransaction
-
WebVitalsCumulativeLayoutShift
-
WebVitalsFirstInputDelay
-
WebVitalsLargestContentfulPaint
-
JsErrorCount
-
HttpErrorCount
-
SessionCount
sourcepub fn value_key(self, input: impl Into<String>) -> Self
pub fn value_key(self, input: impl Into<String>) -> Self
The field within the event object that the metric value is sourced from.
If you omit this field, a hardcoded value of 1 is pushed as the metric value. This is useful if you just want to count the number of events that the filter catches.
If this metric is sent to CloudWatch Evidently, this field will be passed to Evidently raw and Evidently will handle data extraction from the event.
sourcepub fn set_value_key(self, input: Option<String>) -> Self
pub fn set_value_key(self, input: Option<String>) -> Self
The field within the event object that the metric value is sourced from.
If you omit this field, a hardcoded value of 1 is pushed as the metric value. This is useful if you just want to count the number of events that the filter catches.
If this metric is sent to CloudWatch Evidently, this field will be passed to Evidently raw and Evidently will handle data extraction from the event.
sourcepub fn get_value_key(&self) -> &Option<String>
pub fn get_value_key(&self) -> &Option<String>
The field within the event object that the metric value is sourced from.
If you omit this field, a hardcoded value of 1 is pushed as the metric value. This is useful if you just want to count the number of events that the filter catches.
If this metric is sent to CloudWatch Evidently, this field will be passed to Evidently raw and Evidently will handle data extraction from the event.
sourcepub fn unit_label(self, input: impl Into<String>) -> Self
pub fn unit_label(self, input: impl Into<String>) -> Self
The CloudWatch metric unit to use for this metric. If you omit this field, the metric is recorded with no unit.
sourcepub fn set_unit_label(self, input: Option<String>) -> Self
pub fn set_unit_label(self, input: Option<String>) -> Self
The CloudWatch metric unit to use for this metric. If you omit this field, the metric is recorded with no unit.
sourcepub fn get_unit_label(&self) -> &Option<String>
pub fn get_unit_label(&self) -> &Option<String>
The CloudWatch metric unit to use for this metric. If you omit this field, the metric is recorded with no unit.
sourcepub fn dimension_keys(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn dimension_keys(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to dimension_keys
.
To override the contents of this collection use set_dimension_keys
.
Use this field only if you are sending the metric to CloudWatch.
This field is a map of field paths to dimension names. It defines the dimensions to associate with this metric in CloudWatch. For extended metrics, valid values for the entries in this field are the following:
-
"metadata.pageId": "PageId"
-
"metadata.browserName": "BrowserName"
-
"metadata.deviceType": "DeviceType"
-
"metadata.osName": "OSName"
-
"metadata.countryCode": "CountryCode"
-
"event_details.fileType": "FileType"
For both extended metrics and custom metrics, all dimensions listed in this field must also be included in EventPattern
.
sourcepub fn set_dimension_keys(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_dimension_keys(self, input: Option<HashMap<String, String>>) -> Self
Use this field only if you are sending the metric to CloudWatch.
This field is a map of field paths to dimension names. It defines the dimensions to associate with this metric in CloudWatch. For extended metrics, valid values for the entries in this field are the following:
-
"metadata.pageId": "PageId"
-
"metadata.browserName": "BrowserName"
-
"metadata.deviceType": "DeviceType"
-
"metadata.osName": "OSName"
-
"metadata.countryCode": "CountryCode"
-
"event_details.fileType": "FileType"
For both extended metrics and custom metrics, all dimensions listed in this field must also be included in EventPattern
.
sourcepub fn get_dimension_keys(&self) -> &Option<HashMap<String, String>>
pub fn get_dimension_keys(&self) -> &Option<HashMap<String, String>>
Use this field only if you are sending the metric to CloudWatch.
This field is a map of field paths to dimension names. It defines the dimensions to associate with this metric in CloudWatch. For extended metrics, valid values for the entries in this field are the following:
-
"metadata.pageId": "PageId"
-
"metadata.browserName": "BrowserName"
-
"metadata.deviceType": "DeviceType"
-
"metadata.osName": "OSName"
-
"metadata.countryCode": "CountryCode"
-
"event_details.fileType": "FileType"
For both extended metrics and custom metrics, all dimensions listed in this field must also be included in EventPattern
.
sourcepub fn event_pattern(self, input: impl Into<String>) -> Self
pub fn event_pattern(self, input: impl Into<String>) -> Self
The pattern that defines the metric, specified as a JSON object. 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.
When you define extended metrics, the metric definition is not valid if EventPattern
is omitted.
Example event patterns:
-
'{ "event_type": ["com.amazon.rum.js_error_event"], "metadata": { "browserName": [ "Chrome", "Safari" ], } }'
-
'{ "event_type": ["com.amazon.rum.performance_navigation_event"], "metadata": { "browserName": [ "Chrome", "Firefox" ] }, "event_details": { "duration": [{ "numeric": [ "<", 2000 ] }] } }'
-
'{ "event_type": ["com.amazon.rum.performance_navigation_event"], "metadata": { "browserName": [ "Chrome", "Safari" ], "countryCode": [ "US" ] }, "event_details": { "duration": [{ "numeric": [ ">=", 2000, "<", 8000 ] }] } }'
If the metrics destination' is CloudWatch
and the event also matches a value in DimensionKeys
, then the metric is published with the specified dimensions.
sourcepub fn set_event_pattern(self, input: Option<String>) -> Self
pub fn set_event_pattern(self, input: Option<String>) -> Self
The pattern that defines the metric, specified as a JSON object. 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.
When you define extended metrics, the metric definition is not valid if EventPattern
is omitted.
Example event patterns:
-
'{ "event_type": ["com.amazon.rum.js_error_event"], "metadata": { "browserName": [ "Chrome", "Safari" ], } }'
-
'{ "event_type": ["com.amazon.rum.performance_navigation_event"], "metadata": { "browserName": [ "Chrome", "Firefox" ] }, "event_details": { "duration": [{ "numeric": [ "<", 2000 ] }] } }'
-
'{ "event_type": ["com.amazon.rum.performance_navigation_event"], "metadata": { "browserName": [ "Chrome", "Safari" ], "countryCode": [ "US" ] }, "event_details": { "duration": [{ "numeric": [ ">=", 2000, "<", 8000 ] }] } }'
If the metrics destination' is CloudWatch
and the event also matches a value in DimensionKeys
, then the metric is published with the specified dimensions.
sourcepub fn get_event_pattern(&self) -> &Option<String>
pub fn get_event_pattern(&self) -> &Option<String>
The pattern that defines the metric, specified as a JSON object. 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.
When you define extended metrics, the metric definition is not valid if EventPattern
is omitted.
Example event patterns:
-
'{ "event_type": ["com.amazon.rum.js_error_event"], "metadata": { "browserName": [ "Chrome", "Safari" ], } }'
-
'{ "event_type": ["com.amazon.rum.performance_navigation_event"], "metadata": { "browserName": [ "Chrome", "Firefox" ] }, "event_details": { "duration": [{ "numeric": [ "<", 2000 ] }] } }'
-
'{ "event_type": ["com.amazon.rum.performance_navigation_event"], "metadata": { "browserName": [ "Chrome", "Safari" ], "countryCode": [ "US" ] }, "event_details": { "duration": [{ "numeric": [ ">=", 2000, "<", 8000 ] }] } }'
If the metrics destination' is CloudWatch
and the event also matches a value in DimensionKeys
, then the metric is published with the specified dimensions.
sourcepub fn namespace(self, input: impl Into<String>) -> Self
pub fn namespace(self, input: impl Into<String>) -> Self
If this structure is for 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 this structure is for an extended metric.
You cannot use any string that starts with AWS/
for your namespace.
sourcepub fn set_namespace(self, input: Option<String>) -> Self
pub fn set_namespace(self, input: Option<String>) -> Self
If this structure is for 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 this structure is for an extended metric.
You cannot use any string that starts with AWS/
for your namespace.
sourcepub fn get_namespace(&self) -> &Option<String>
pub fn get_namespace(&self) -> &Option<String>
If this structure is for 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 this structure is for an extended metric.
You cannot use any string that starts with AWS/
for your namespace.
sourcepub fn build(self) -> MetricDefinitionRequest
pub fn build(self) -> MetricDefinitionRequest
Consumes the builder and constructs a MetricDefinitionRequest
.
Trait Implementations§
source§impl Clone for MetricDefinitionRequestBuilder
impl Clone for MetricDefinitionRequestBuilder
source§fn clone(&self) -> MetricDefinitionRequestBuilder
fn clone(&self) -> MetricDefinitionRequestBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Default for MetricDefinitionRequestBuilder
impl Default for MetricDefinitionRequestBuilder
source§fn default() -> MetricDefinitionRequestBuilder
fn default() -> MetricDefinitionRequestBuilder
source§impl PartialEq for MetricDefinitionRequestBuilder
impl PartialEq for MetricDefinitionRequestBuilder
source§fn eq(&self, other: &MetricDefinitionRequestBuilder) -> bool
fn eq(&self, other: &MetricDefinitionRequestBuilder) -> bool
self
and other
values to be equal, and is used
by ==
.