Skip to main content

rum_metric_definitions

Creates, updates, deletes, gets or lists a rum_metric_definitions resource.

Overview

Namerum_metric_definitions
TypeResource
Idaws.rum.rum_metric_definitions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
dimension_keysobjectThis 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 is CloudWatch. If the metric destination is Evidently, the value of DimensionKeys is ignored.
event_patternstringThe 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 in DimensionKeys, then the metric is published with the specified dimensions.
metric_definition_idstringThe ID of this metric definition.
namestringThe name of the metric that is defined in this structure.
namespacestringIf this metric definition is for a custom metric instead of an extended metric, this field displays the metric namespace that the custom metric is published to. (pattern: <code>.*[a-zA-Z0-9-._/#:]+</code>)
unit_labelstringUse this field only if you are sending this metric to CloudWatch. It defines the CloudWatch metric unit that this metric is measured in.
value_keystringThe field within the event object that the metric value is sourced from.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
batch_get_rum_metric_definitionsselectapp_monitor_name, destination, regiondestinationArn, maxResults, nextTokenRetrieves the list of metrics and dimensions that a RUM app monitor is sending to a single destination.
update_rum_metric_definitionupdateapp_monitor_name, region, MetricDefinition, MetricDefinitionIdModifies one existing metric definition for CloudWatch RUM extended metrics. For more information about extended metrics, see BatchCreateRumMetricsDefinitions.
batch_create_rum_metric_definitionsexecapp_monitor_name, region, MetricDefinitionsSpecifies the extended metrics and custom metrics that you want a CloudWatch RUM app monitor to send to a destination. Valid destinations include CloudWatch and Evidently. By default, RUM app monitors send some metrics to CloudWatch. These default metrics are listed in CloudWatch metrics that you can collect with CloudWatch RUM. In addition to these default metrics, you can choose to send extended metrics, custom metrics, or both. Extended metrics let you send metrics with additional dimensions that aren't included in the default metrics. You can also send extended metrics to both Evidently and CloudWatch. The valid dimension names for the additional dimensions for extended metrics are BrowserName, CountryCode, DeviceType, FileType, OSName, and PageId. For more information, see Extended metrics that you can send to CloudWatch and CloudWatch Evidently. Custom metrics are metrics that you define. You can send custom metrics to CloudWatch. CloudWatch Evidently, or both. With custom metrics, you can use any metric name and namespace. To derive the metrics, you can use any custom events, built-in events, custom attributes, or default attributes. You can't send custom metrics to the AWS/RUM namespace. You must send custom metrics to a custom namespace that you define. The namespace that you use can't start with AWS/. CloudWatch RUM prepends RUM/CustomMetrics/ to the custom namespace that you define, so the final namespace for your metrics in CloudWatch is RUM/CustomMetrics/your-custom-namespace . The maximum number of metric definitions that you can specify in one BatchCreateRumMetricDefinitions operation is 200. The maximum number of metric definitions that one destination can contain is 2000. Extended metrics sent to CloudWatch and RUM custom metrics are charged as CloudWatch custom metrics. Each combination of additional dimension name and dimension value counts as a custom metric. For more information, see Amazon CloudWatch Pricing. You must have already created a destination for the metrics before you send them. For more information, see PutRumMetricsDestination. If some metric definitions specified in a BatchCreateRumMetricDefinitions operations are not valid, those metric definitions fail and return errors, but all valid metric definitions in the same operation still succeed.
batch_delete_rum_metric_definitionsexecapp_monitor_name, destination, metricDefinitionIds, regiondestinationArnRemoves the specified metrics from being sent to an extended metrics destination. If some metric definition IDs specified in a BatchDeleteRumMetricDefinitions operations are not valid, those metric definitions fail and return errors, but all valid metric definition IDs in the same operation are still deleted. The maximum number of metric definitions that you can specify in one BatchDeleteRumMetricDefinitions operation is 200.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
app_monitor_namestringThe name of the CloudWatch RUM app monitor that is sending these metrics.
destinationstringDefines the destination where you want to stop sending the specified metrics. Valid values are CloudWatch and Evidently. If you specify Evidently, you must also specify the ARN of the CloudWatchEvidently experiment that is to be the destination and an IAM role that has permission to write to the experiment.
metricDefinitionIdsarrayAn array of structures which define the metrics that you want to stop sending.
regionstringAWS region (default: us-east-1)
destinationArnstringThis parameter is required if Destination is Evidently. If Destination is CloudWatch, do not use this parameter. This parameter specifies the ARN of the Evidently experiment that was receiving the metrics that are being deleted.
maxResultsintegerThe maximum number of results to return in one operation. The default is 50. The maximum that you can specify is 100. To retrieve the remaining results, make another call with the returned NextToken value.
nextTokenstringUse the token returned by the previous operation to request the next page of results.

SELECT examples

Retrieves the list of metrics and dimensions that a RUM app monitor is sending to a single destination.

SELECT
dimension_keys,
event_pattern,
metric_definition_id,
name,
namespace,
unit_label,
value_key
FROM aws.rum.rum_metric_definitions
WHERE app_monitor_name = '{{ app_monitor_name }}' -- required
AND destination = '{{ destination }}' -- required
AND region = '{{ region }}' -- required
AND destinationArn = '{{ destinationArn }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;

UPDATE examples

Modifies one existing metric definition for CloudWatch RUM extended metrics. For more information about extended metrics, see BatchCreateRumMetricsDefinitions.

UPDATE aws.rum.rum_metric_definitions
SET
Destination = '{{ Destination }}',
DestinationArn = '{{ DestinationArn }}',
MetricDefinition = '{{ MetricDefinition }}',
MetricDefinitionId = '{{ MetricDefinitionId }}'
WHERE
app_monitor_name = '{{ app_monitor_name }}' --required
AND region = '{{ region }}' --required
AND MetricDefinition = '{{ MetricDefinition }}' --required
AND MetricDefinitionId = '{{ MetricDefinitionId }}' --required;

Lifecycle Methods

Specifies the extended metrics and custom metrics that you want a CloudWatch RUM app monitor to send to a destination. Valid destinations include CloudWatch and Evidently. By default, RUM app monitors send some metrics to CloudWatch. These default metrics are listed in CloudWatch metrics that you can collect with CloudWatch RUM. In addition to these default metrics, you can choose to send extended metrics, custom metrics, or both. Extended metrics let you send metrics with additional dimensions that aren't included in the default metrics. You can also send extended metrics to both Evidently and CloudWatch. The valid dimension names for the additional dimensions for extended metrics are BrowserName, CountryCode, DeviceType, FileType, OSName, and PageId. For more information, see Extended metrics that you can send to CloudWatch and CloudWatch Evidently. Custom metrics are metrics that you define. You can send custom metrics to CloudWatch. CloudWatch Evidently, or both. With custom metrics, you can use any metric name and namespace. To derive the metrics, you can use any custom events, built-in events, custom attributes, or default attributes. You can't send custom metrics to the AWS/RUM namespace. You must send custom metrics to a custom namespace that you define. The namespace that you use can't start with AWS/. CloudWatch RUM prepends RUM/CustomMetrics/ to the custom namespace that you define, so the final namespace for your metrics in CloudWatch is RUM/CustomMetrics/your-custom-namespace . The maximum number of metric definitions that you can specify in one BatchCreateRumMetricDefinitions operation is 200. The maximum number of metric definitions that one destination can contain is 2000. Extended metrics sent to CloudWatch and RUM custom metrics are charged as CloudWatch custom metrics. Each combination of additional dimension name and dimension value counts as a custom metric. For more information, see Amazon CloudWatch Pricing. You must have already created a destination for the metrics before you send them. For more information, see PutRumMetricsDestination. If some metric definitions specified in a BatchCreateRumMetricDefinitions operations are not valid, those metric definitions fail and return errors, but all valid metric definitions in the same operation still succeed.

EXEC aws.rum.rum_metric_definitions.batch_create_rum_metric_definitions
@app_monitor_name='{{ app_monitor_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"Destination": "{{ Destination }}",
"DestinationArn": "{{ DestinationArn }}",
"MetricDefinitions": "{{ MetricDefinitions }}"
}'
;