SDK for PHP 3.x

Client: Aws\CloudWatchRUM\CloudWatchRUMClient
Service ID: rum
Version: 2018-05-10

This page describes the parameters and results for the operations of the CloudWatch RUM (2018-05-10), and shows how to use the Aws\CloudWatchRUM\CloudWatchRUMClient object to call the described operations. This documentation is specific to the 2018-05-10 API version of the service.

Operation Summary

Each of the following operations can be created from a client using $client->getCommand('CommandName'), where "CommandName" is the name of one of the following operations. Note: a command is a value that encapsulates an operation and the parameters used to create an HTTP request.

You can also create and send a command immediately using the magic methods available on a client object: $client->commandName(/* parameters */). You can send the command asynchronously (returning a promise) by appending the word "Async" to the operation name: $client->commandNameAsync(/* parameters */).

BatchCreateRumMetricDefinitions ( array $params = [] )
Specifies the extended metrics and custom metrics that you want a CloudWatch RUM app monitor to send to a destination.
BatchDeleteRumMetricDefinitions ( array $params = [] )
Removes the specified metrics from being sent to an extended metrics destination.
BatchGetRumMetricDefinitions ( array $params = [] )
Retrieves the list of metrics and dimensions that a RUM app monitor is sending to a single destination.
CreateAppMonitor ( array $params = [] )
Creates a Amazon CloudWatch RUM app monitor, which collects telemetry data from your application and sends that data to RUM.
DeleteAppMonitor ( array $params = [] )
Deletes an existing app monitor.
DeleteRumMetricsDestination ( array $params = [] )
Deletes a destination for CloudWatch RUM extended metrics, so that the specified app monitor stops sending extended metrics to that destination.
GetAppMonitor ( array $params = [] )
Retrieves the complete configuration information for one app monitor.
GetAppMonitorData ( array $params = [] )
Retrieves the raw performance events that RUM has collected from your web application, so that you can do your own processing or analysis of this data.
ListAppMonitors ( array $params = [] )
Returns a list of the Amazon CloudWatch RUM app monitors in the account.
ListRumMetricsDestinations ( array $params = [] )
Returns a list of destinations that you have created to receive RUM extended metrics, for the specified app monitor.
ListTagsForResource ( array $params = [] )
Displays the tags associated with a CloudWatch RUM resource.
PutRumEvents ( array $params = [] )
Sends telemetry events about your application performance and user behavior to CloudWatch RUM.
PutRumMetricsDestination ( array $params = [] )
Creates or updates a destination to receive extended metrics from CloudWatch RUM.
TagResource ( array $params = [] )
Assigns one or more tags (key-value pairs) to the specified CloudWatch RUM resource.
UntagResource ( array $params = [] )
Removes one or more tags from the specified resource.
UpdateAppMonitor ( array $params = [] )
Updates the configuration of an existing app monitor.
UpdateRumMetricDefinition ( array $params = [] )
Modifies one existing metric definition for CloudWatch RUM extended metrics.

Paginators

Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:

BatchGetRumMetricDefinitions
GetAppMonitorData
ListAppMonitors
ListRumMetricsDestinations

Operations

BatchCreateRumMetricDefinitions

$result = $client->batchCreateRumMetricDefinitions([/* ... */]);
$promise = $client->batchCreateRumMetricDefinitionsAsync([/* ... */]);

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.

Parameter Syntax

$result = $client->batchCreateRumMetricDefinitions([
    'AppMonitorName' => '<string>', // REQUIRED
    'Destination' => 'CloudWatch|Evidently', // REQUIRED
    'DestinationArn' => '<string>',
    'MetricDefinitions' => [ // REQUIRED
        [
            'DimensionKeys' => ['<string>', ...],
            'EventPattern' => '<string>',
            'Name' => '<string>', // REQUIRED
            'Namespace' => '<string>',
            'UnitLabel' => '<string>',
            'ValueKey' => '<string>',
        ],
        // ...
    ],
]);

Parameter Details

Members
AppMonitorName
Required: Yes
Type: string

The name of the CloudWatch RUM app monitor that is to send the metrics.

Destination
Required: Yes
Type: string

The destination to send the metrics to. Valid values are CloudWatch and Evidently. If you specify Evidently, you must also specify the Amazon Resource Name (ARN) of the CloudWatchEvidently experiment that will receive the metrics and an IAM role that has permission to write to the experiment.

DestinationArn
Type: string

This 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 is to receive the metrics. You must have already defined this experiment as a valid destination. For more information, see PutRumMetricsDestination.

MetricDefinitions
Required: Yes
Type: Array of MetricDefinitionRequest structures

An array of structures which define the metrics that you want to send.

Result Syntax

[
    'Errors' => [
        [
            'ErrorCode' => '<string>',
            'ErrorMessage' => '<string>',
            'MetricDefinition' => [
                'DimensionKeys' => ['<string>', ...],
                'EventPattern' => '<string>',
                'Name' => '<string>',
                'Namespace' => '<string>',
                'UnitLabel' => '<string>',
                'ValueKey' => '<string>',
            ],
        ],
        // ...
    ],
    'MetricDefinitions' => [
        [
            'DimensionKeys' => ['<string>', ...],
            'EventPattern' => '<string>',
            'MetricDefinitionId' => '<string>',
            'Name' => '<string>',
            'Namespace' => '<string>',
            'UnitLabel' => '<string>',
            'ValueKey' => '<string>',
        ],
        // ...
    ],
]

Result Details

Members
Errors
Required: Yes
Type: Array of BatchCreateRumMetricDefinitionsError structures

An array of error objects, if the operation caused any errors.

MetricDefinitions
Type: Array of MetricDefinition structures

An array of structures that define the extended metrics.

Errors

ConflictException:

This operation attempted to create a resource that already exists.

ServiceQuotaExceededException:

This request exceeds a service quota.

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

BatchDeleteRumMetricDefinitions

$result = $client->batchDeleteRumMetricDefinitions([/* ... */]);
$promise = $client->batchDeleteRumMetricDefinitionsAsync([/* ... */]);

Removes 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.

Parameter Syntax

$result = $client->batchDeleteRumMetricDefinitions([
    'AppMonitorName' => '<string>', // REQUIRED
    'Destination' => 'CloudWatch|Evidently', // REQUIRED
    'DestinationArn' => '<string>',
    'MetricDefinitionIds' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
AppMonitorName
Required: Yes
Type: string

The name of the CloudWatch RUM app monitor that is sending these metrics.

Destination
Required: Yes
Type: string

Defines 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.

DestinationArn
Type: string

This 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.

MetricDefinitionIds
Required: Yes
Type: Array of strings

An array of structures which define the metrics that you want to stop sending.

Result Syntax

[
    'Errors' => [
        [
            'ErrorCode' => '<string>',
            'ErrorMessage' => '<string>',
            'MetricDefinitionId' => '<string>',
        ],
        // ...
    ],
    'MetricDefinitionIds' => ['<string>', ...],
]

Result Details

Members
Errors
Required: Yes
Type: Array of BatchDeleteRumMetricDefinitionsError structures

An array of error objects, if the operation caused any errors.

MetricDefinitionIds
Type: Array of strings

The IDs of the metric definitions that were deleted.

Errors

ConflictException:

This operation attempted to create a resource that already exists.

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

BatchGetRumMetricDefinitions

$result = $client->batchGetRumMetricDefinitions([/* ... */]);
$promise = $client->batchGetRumMetricDefinitionsAsync([/* ... */]);

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

Parameter Syntax

$result = $client->batchGetRumMetricDefinitions([
    'AppMonitorName' => '<string>', // REQUIRED
    'Destination' => 'CloudWatch|Evidently', // REQUIRED
    'DestinationArn' => '<string>',
    'MaxResults' => <integer>,
    'NextToken' => '<string>',
]);

Parameter Details

Members
AppMonitorName
Required: Yes
Type: string

The name of the CloudWatch RUM app monitor that is sending the metrics.

Destination
Required: Yes
Type: string

The type of destination that you want to view metrics for. Valid values are CloudWatch and Evidently.

DestinationArn
Type: string

This 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 corresponds to the destination.

MaxResults
Type: int

The 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.

NextToken
Type: string

Use the token returned by the previous operation to request the next page of results.

Result Syntax

[
    'MetricDefinitions' => [
        [
            'DimensionKeys' => ['<string>', ...],
            'EventPattern' => '<string>',
            'MetricDefinitionId' => '<string>',
            'Name' => '<string>',
            'Namespace' => '<string>',
            'UnitLabel' => '<string>',
            'ValueKey' => '<string>',
        ],
        // ...
    ],
    'NextToken' => '<string>',
]

Result Details

Members
MetricDefinitions
Type: Array of MetricDefinition structures

An array of structures that display information about the metrics that are sent by the specified app monitor to the specified destination.

NextToken
Type: string

A token that you can use in a subsequent operation to retrieve the next set of results.

Errors

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

CreateAppMonitor

$result = $client->createAppMonitor([/* ... */]);
$promise = $client->createAppMonitorAsync([/* ... */]);

Creates a Amazon CloudWatch RUM app monitor, which collects telemetry data from your application and sends that data to RUM. The data includes performance and reliability information such as page load time, client-side errors, and user behavior.

You use this operation only to create a new app monitor. To update an existing app monitor, use UpdateAppMonitor instead.

After you create an app monitor, sign in to the CloudWatch RUM console to get the JavaScript code snippet to add to your web application. For more information, see How do I find a code snippet that I've already generated?

Parameter Syntax

$result = $client->createAppMonitor([
    'AppMonitorConfiguration' => [
        'AllowCookies' => true || false,
        'EnableXRay' => true || false,
        'ExcludedPages' => ['<string>', ...],
        'FavoritePages' => ['<string>', ...],
        'GuestRoleArn' => '<string>',
        'IdentityPoolId' => '<string>',
        'IncludedPages' => ['<string>', ...],
        'SessionSampleRate' => <float>,
        'Telemetries' => ['<string>', ...],
    ],
    'CustomEvents' => [
        'Status' => 'ENABLED|DISABLED',
    ],
    'CwLogEnabled' => true || false,
    'Domain' => '<string>', // REQUIRED
    'Name' => '<string>', // REQUIRED
    'Tags' => ['<string>', ...],
]);

Parameter Details

Members
AppMonitorConfiguration
Type: AppMonitorConfiguration structure

A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include AppMonitorConfiguration, you must set up your own authorization method. For more information, see Authorize your application to send data to Amazon Web Services.

If you omit this argument, the sample rate used for RUM is set to 10% of the user sessions.

CustomEvents
Type: CustomEvents structure

Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are DISABLED.

For more information about custom events, see Send custom events.

CwLogEnabled
Type: boolean

Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.

If you omit this parameter, the default is false.

Domain
Required: Yes
Type: string

The top-level internet domain name for which your application has administrative authority.

Name
Required: Yes
Type: string

A name for the app monitor.

Tags
Type: Associative array of custom strings keys (TagKey) to strings

Assigns one or more tags (key-value pairs) to the app monitor.

Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.

Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.

You can associate as many as 50 tags with an app monitor.

For more information, see Tagging Amazon Web Services resources.

Result Syntax

[
    'Id' => '<string>',
]

Result Details

Members
Id
Type: string

The unique ID of the new app monitor.

Errors

ConflictException:

This operation attempted to create a resource that already exists.

ServiceQuotaExceededException:

This request exceeds a service quota.

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

DeleteAppMonitor

$result = $client->deleteAppMonitor([/* ... */]);
$promise = $client->deleteAppMonitorAsync([/* ... */]);

Deletes an existing app monitor. This immediately stops the collection of data.

Parameter Syntax

$result = $client->deleteAppMonitor([
    'Name' => '<string>', // REQUIRED
]);

Parameter Details

Members
Name
Required: Yes
Type: string

The name of the app monitor to delete.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ConflictException:

This operation attempted to create a resource that already exists.

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

DeleteRumMetricsDestination

$result = $client->deleteRumMetricsDestination([/* ... */]);
$promise = $client->deleteRumMetricsDestinationAsync([/* ... */]);

Deletes a destination for CloudWatch RUM extended metrics, so that the specified app monitor stops sending extended metrics to that destination.

Parameter Syntax

$result = $client->deleteRumMetricsDestination([
    'AppMonitorName' => '<string>', // REQUIRED
    'Destination' => 'CloudWatch|Evidently', // REQUIRED
    'DestinationArn' => '<string>',
]);

Parameter Details

Members
AppMonitorName
Required: Yes
Type: string

The name of the app monitor that is sending metrics to the destination that you want to delete.

Destination
Required: Yes
Type: string

The type of destination to delete. Valid values are CloudWatch and Evidently.

DestinationArn
Type: string

This 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 corresponds to the destination to delete.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ConflictException:

This operation attempted to create a resource that already exists.

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

GetAppMonitor

$result = $client->getAppMonitor([/* ... */]);
$promise = $client->getAppMonitorAsync([/* ... */]);

Retrieves the complete configuration information for one app monitor.

Parameter Syntax

$result = $client->getAppMonitor([
    'Name' => '<string>', // REQUIRED
]);

Parameter Details

Members
Name
Required: Yes
Type: string

The app monitor to retrieve information for.

Result Syntax

[
    'AppMonitor' => [
        'AppMonitorConfiguration' => [
            'AllowCookies' => true || false,
            'EnableXRay' => true || false,
            'ExcludedPages' => ['<string>', ...],
            'FavoritePages' => ['<string>', ...],
            'GuestRoleArn' => '<string>',
            'IdentityPoolId' => '<string>',
            'IncludedPages' => ['<string>', ...],
            'SessionSampleRate' => <float>,
            'Telemetries' => ['<string>', ...],
        ],
        'Created' => '<string>',
        'CustomEvents' => [
            'Status' => 'ENABLED|DISABLED',
        ],
        'DataStorage' => [
            'CwLog' => [
                'CwLogEnabled' => true || false,
                'CwLogGroup' => '<string>',
            ],
        ],
        'Domain' => '<string>',
        'Id' => '<string>',
        'LastModified' => '<string>',
        'Name' => '<string>',
        'State' => 'CREATED|DELETING|ACTIVE',
        'Tags' => ['<string>', ...],
    ],
]

Result Details

Members
AppMonitor
Type: AppMonitor structure

A structure containing all the configuration information for the app monitor.

Errors

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

GetAppMonitorData

$result = $client->getAppMonitorData([/* ... */]);
$promise = $client->getAppMonitorDataAsync([/* ... */]);

Retrieves the raw performance events that RUM has collected from your web application, so that you can do your own processing or analysis of this data.

Parameter Syntax

$result = $client->getAppMonitorData([
    'Filters' => [
        [
            'Name' => '<string>',
            'Values' => ['<string>', ...],
        ],
        // ...
    ],
    'MaxResults' => <integer>,
    'Name' => '<string>', // REQUIRED
    'NextToken' => '<string>',
    'TimeRange' => [ // REQUIRED
        'After' => <integer>, // REQUIRED
        'Before' => <integer>,
    ],
]);

Parameter Details

Members
Filters
Type: Array of QueryFilter structures

An array of structures that you can use to filter the results to those that match one or more sets of key-value pairs that you specify.

MaxResults
Type: int

The maximum number of results to return in one operation.

Name
Required: Yes
Type: string

The name of the app monitor that collected the data that you want to retrieve.

NextToken
Type: string

Use the token returned by the previous operation to request the next page of results.

TimeRange
Required: Yes
Type: TimeRange structure

A structure that defines the time range that you want to retrieve results from.

Result Syntax

[
    'Events' => ['<string>', ...],
    'NextToken' => '<string>',
]

Result Details

Members
Events
Type: Array of strings

The events that RUM collected that match your request.

NextToken
Type: string

A token that you can use in a subsequent operation to retrieve the next set of results.

Errors

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

ListAppMonitors

$result = $client->listAppMonitors([/* ... */]);
$promise = $client->listAppMonitorsAsync([/* ... */]);

Returns a list of the Amazon CloudWatch RUM app monitors in the account.

Parameter Syntax

$result = $client->listAppMonitors([
    'MaxResults' => <integer>,
    'NextToken' => '<string>',
]);

Parameter Details

Members
MaxResults
Type: int

The maximum number of results to return in one operation. The default is 50. The maximum that you can specify is 100.

NextToken
Type: string

Use the token returned by the previous operation to request the next page of results.

Result Syntax

[
    'AppMonitorSummaries' => [
        [
            'Created' => '<string>',
            'Id' => '<string>',
            'LastModified' => '<string>',
            'Name' => '<string>',
            'State' => 'CREATED|DELETING|ACTIVE',
        ],
        // ...
    ],
    'NextToken' => '<string>',
]

Result Details

Members
AppMonitorSummaries
Type: Array of AppMonitorSummary structures

An array of structures that contain information about the returned app monitors.

NextToken
Type: string

A token that you can use in a subsequent operation to retrieve the next set of results.

Errors

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

ListRumMetricsDestinations

$result = $client->listRumMetricsDestinations([/* ... */]);
$promise = $client->listRumMetricsDestinationsAsync([/* ... */]);

Returns a list of destinations that you have created to receive RUM extended metrics, for the specified app monitor.

For more information about extended metrics, see AddRumMetrics.

Parameter Syntax

$result = $client->listRumMetricsDestinations([
    'AppMonitorName' => '<string>', // REQUIRED
    'MaxResults' => <integer>,
    'NextToken' => '<string>',
]);

Parameter Details

Members
AppMonitorName
Required: Yes
Type: string

The name of the app monitor associated with the destinations that you want to retrieve.

MaxResults
Type: int

The 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.

NextToken
Type: string

Use the token returned by the previous operation to request the next page of results.

Result Syntax

[
    'Destinations' => [
        [
            'Destination' => 'CloudWatch|Evidently',
            'DestinationArn' => '<string>',
            'IamRoleArn' => '<string>',
        ],
        // ...
    ],
    'NextToken' => '<string>',
]

Result Details

Members
Destinations
Type: Array of MetricDestinationSummary structures

The list of CloudWatch RUM extended metrics destinations associated with the app monitor that you specified.

NextToken
Type: string

A token that you can use in a subsequent operation to retrieve the next set of results.

Errors

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

ListTagsForResource

$result = $client->listTagsForResource([/* ... */]);
$promise = $client->listTagsForResourceAsync([/* ... */]);

Displays the tags associated with a CloudWatch RUM resource.

Parameter Syntax

$result = $client->listTagsForResource([
    'ResourceArn' => '<string>', // REQUIRED
]);

Parameter Details

Members
ResourceArn
Required: Yes
Type: string

The ARN of the resource that you want to see the tags of.

Result Syntax

[
    'ResourceArn' => '<string>',
    'Tags' => ['<string>', ...],
]

Result Details

Members
ResourceArn
Required: Yes
Type: string

The ARN of the resource that you are viewing.

Tags
Required: Yes
Type: Associative array of custom strings keys (TagKey) to strings

The list of tag keys and values associated with the resource you specified.

Errors

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

PutRumEvents

$result = $client->putRumEvents([/* ... */]);
$promise = $client->putRumEventsAsync([/* ... */]);

Sends telemetry events about your application performance and user behavior to CloudWatch RUM. The code snippet that RUM generates for you to add to your application includes PutRumEvents operations to send this data to RUM.

Each PutRumEvents operation can send a batch of events from one user session.

Parameter Syntax

$result = $client->putRumEvents([
    'AppMonitorDetails' => [ // REQUIRED
        'id' => '<string>',
        'name' => '<string>',
        'version' => '<string>',
    ],
    'BatchId' => '<string>', // REQUIRED
    'Id' => '<string>', // REQUIRED
    'RumEvents' => [ // REQUIRED
        [
            'details' => '<string>', // REQUIRED
            'id' => '<string>', // REQUIRED
            'metadata' => '<string>',
            'timestamp' => <integer || string || DateTime>, // REQUIRED
            'type' => '<string>', // REQUIRED
        ],
        // ...
    ],
    'UserDetails' => [ // REQUIRED
        'sessionId' => '<string>',
        'userId' => '<string>',
    ],
]);

Parameter Details

Members
AppMonitorDetails
Required: Yes
Type: AppMonitorDetails structure

A structure that contains information about the app monitor that collected this telemetry information.

BatchId
Required: Yes
Type: string

A unique identifier for this batch of RUM event data.

Id
Required: Yes
Type: string

The ID of the app monitor that is sending this data.

RumEvents
Required: Yes
Type: Array of RumEvent structures

An array of structures that contain the telemetry event data.

UserDetails
Required: Yes
Type: UserDetails structure

A structure that contains information about the user session that this batch of events was collected from.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

PutRumMetricsDestination

$result = $client->putRumMetricsDestination([/* ... */]);
$promise = $client->putRumMetricsDestinationAsync([/* ... */]);

Creates or updates a destination to receive extended metrics from CloudWatch RUM. You can send extended metrics to CloudWatch or to a CloudWatch Evidently experiment.

For more information about extended metrics, see BatchCreateRumMetricDefinitions.

Parameter Syntax

$result = $client->putRumMetricsDestination([
    'AppMonitorName' => '<string>', // REQUIRED
    'Destination' => 'CloudWatch|Evidently', // REQUIRED
    'DestinationArn' => '<string>',
    'IamRoleArn' => '<string>',
]);

Parameter Details

Members
AppMonitorName
Required: Yes
Type: string

The name of the CloudWatch RUM app monitor that will send the metrics.

Destination
Required: Yes
Type: string

Defines the destination to send the metrics to. 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.

DestinationArn
Type: string

Use this parameter only if Destination is Evidently. This parameter specifies the ARN of the Evidently experiment that will receive the extended metrics.

IamRoleArn
Type: string

This parameter is required if Destination is Evidently. If Destination is CloudWatch, don't use this parameter.

This parameter specifies the ARN of an IAM role that RUM will assume to write to the Evidently experiment that you are sending metrics to. This role must have permission to write to that experiment.

If you specify this parameter, you must be signed on to a role that has PassRole permissions attached to it, to allow the role to be passed. The CloudWatchAmazonCloudWatchRUMFullAccess policy doesn't include PassRole permissions.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ConflictException:

This operation attempted to create a resource that already exists.

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

TagResource

$result = $client->tagResource([/* ... */]);
$promise = $client->tagResourceAsync([/* ... */]);

Assigns one or more tags (key-value pairs) to the specified CloudWatch RUM resource. Currently, the only resources that can be tagged app monitors.

Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.

Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.

You can use the TagResource action with a resource that already has tags. If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the alarm. If you specify a tag key that is already associated with the resource, the new tag value that you specify replaces the previous value for that tag.

You can associate as many as 50 tags with a resource.

For more information, see Tagging Amazon Web Services resources.

Parameter Syntax

$result = $client->tagResource([
    'ResourceArn' => '<string>', // REQUIRED
    'Tags' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
ResourceArn
Required: Yes
Type: string

The ARN of the CloudWatch RUM resource that you're adding tags to.

Tags
Required: Yes
Type: Associative array of custom strings keys (TagKey) to strings

The list of key-value pairs to associate with the resource.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

UntagResource

$result = $client->untagResource([/* ... */]);
$promise = $client->untagResourceAsync([/* ... */]);

Removes one or more tags from the specified resource.

Parameter Syntax

$result = $client->untagResource([
    'ResourceArn' => '<string>', // REQUIRED
    'TagKeys' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
ResourceArn
Required: Yes
Type: string

The ARN of the CloudWatch RUM resource that you're removing tags from.

TagKeys
Required: Yes
Type: Array of strings

The list of tag keys to remove from the resource.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

UpdateAppMonitor

$result = $client->updateAppMonitor([/* ... */]);
$promise = $client->updateAppMonitorAsync([/* ... */]);

Updates the configuration of an existing app monitor. When you use this operation, only the parts of the app monitor configuration that you specify in this operation are changed. For any parameters that you omit, the existing values are kept.

You can't use this operation to change the tags of an existing app monitor. To change the tags of an existing app monitor, use TagResource.

To create a new app monitor, use CreateAppMonitor.

After you update an app monitor, sign in to the CloudWatch RUM console to get the updated JavaScript code snippet to add to your web application. For more information, see How do I find a code snippet that I've already generated?

Parameter Syntax

$result = $client->updateAppMonitor([
    'AppMonitorConfiguration' => [
        'AllowCookies' => true || false,
        'EnableXRay' => true || false,
        'ExcludedPages' => ['<string>', ...],
        'FavoritePages' => ['<string>', ...],
        'GuestRoleArn' => '<string>',
        'IdentityPoolId' => '<string>',
        'IncludedPages' => ['<string>', ...],
        'SessionSampleRate' => <float>,
        'Telemetries' => ['<string>', ...],
    ],
    'CustomEvents' => [
        'Status' => 'ENABLED|DISABLED',
    ],
    'CwLogEnabled' => true || false,
    'Domain' => '<string>',
    'Name' => '<string>', // REQUIRED
]);

Parameter Details

Members
AppMonitorConfiguration
Type: AppMonitorConfiguration structure

A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include AppMonitorConfiguration, you must set up your own authorization method. For more information, see Authorize your application to send data to Amazon Web Services.

CustomEvents
Type: CustomEvents structure

Specifies whether this app monitor allows the web client to define and send custom events. The default is for custom events to be DISABLED.

For more information about custom events, see Send custom events.

CwLogEnabled
Type: boolean

Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.

Domain
Type: string

The top-level internet domain name for which your application has administrative authority.

Name
Required: Yes
Type: string

The name of the app monitor to update.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ConflictException:

This operation attempted to create a resource that already exists.

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

UpdateRumMetricDefinition

$result = $client->updateRumMetricDefinition([/* ... */]);
$promise = $client->updateRumMetricDefinitionAsync([/* ... */]);

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

Parameter Syntax

$result = $client->updateRumMetricDefinition([
    'AppMonitorName' => '<string>', // REQUIRED
    'Destination' => 'CloudWatch|Evidently', // REQUIRED
    'DestinationArn' => '<string>',
    'MetricDefinition' => [ // REQUIRED
        'DimensionKeys' => ['<string>', ...],
        'EventPattern' => '<string>',
        'Name' => '<string>', // REQUIRED
        'Namespace' => '<string>',
        'UnitLabel' => '<string>',
        'ValueKey' => '<string>',
    ],
    'MetricDefinitionId' => '<string>', // REQUIRED
]);

Parameter Details

Members
AppMonitorName
Required: Yes
Type: string

The name of the CloudWatch RUM app monitor that sends these metrics.

Destination
Required: Yes
Type: string

The destination to send the metrics to. Valid values are CloudWatch and Evidently. If you specify Evidently, you must also specify the ARN of the CloudWatchEvidently experiment that will receive the metrics and an IAM role that has permission to write to the experiment.

DestinationArn
Type: string

This 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 is to receive the metrics. You must have already defined this experiment as a valid destination. For more information, see PutRumMetricsDestination.

MetricDefinition
Required: Yes
Type: MetricDefinitionRequest structure

A structure that contains the new definition that you want to use for this metric.

MetricDefinitionId
Required: Yes
Type: string

The ID of the metric definition to update.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ConflictException:

This operation attempted to create a resource that already exists.

ServiceQuotaExceededException:

This request exceeds a service quota.

ResourceNotFoundException:

Resource not found.

InternalServerException:

Internal service exception.

ValidationException:

One of the arguments for the request is not valid.

ThrottlingException:

The request was throttled because of quota limits.

AccessDeniedException:

You don't have sufficient permissions to perform this action.

Shapes

AccessDeniedException

Description

You don't have sufficient permissions to perform this action.

Members
message
Required: Yes
Type: string

AppMonitor

Description

A RUM app monitor collects telemetry data from your application and sends that data to RUM. The data includes performance and reliability information such as page load time, client-side errors, and user behavior.

Members
AppMonitorConfiguration
Type: AppMonitorConfiguration structure

A structure that contains much of the configuration data for the app monitor.

Created
Type: string

The date and time that this app monitor was created.

CustomEvents
Type: CustomEvents structure

Specifies whether this app monitor allows the web client to define and send custom events.

For more information about custom events, see Send custom events.

DataStorage
Type: DataStorage structure

A structure that contains information about whether this app monitor stores a copy of the telemetry data that RUM collects using CloudWatch Logs.

Domain
Type: string

The top-level internet domain name for which your application has administrative authority.

Id
Type: string

The unique ID of this app monitor.

LastModified
Type: string

The date and time of the most recent changes to this app monitor's configuration.

Name
Type: string

The name of the app monitor.

State
Type: string

The current state of the app monitor.

Tags
Type: Associative array of custom strings keys (TagKey) to strings

The list of tag keys and values associated with this app monitor.

AppMonitorConfiguration

Description

This structure contains much of the configuration data for the app monitor.

Members
AllowCookies
Type: boolean

If you set this to true, the RUM web client sets two cookies, a session cookie and a user cookie. The cookies allow the RUM web client to collect data relating to the number of users an application has and the behavior of the application across a sequence of events. Cookies are stored in the top-level domain of the current page.

EnableXRay
Type: boolean

If you set this to true, RUM enables X-Ray tracing for the user sessions that RUM samples. RUM adds an X-Ray trace header to allowed HTTP requests. It also records an X-Ray segment for allowed HTTP requests. You can see traces and segments from these user sessions in the X-Ray console and the CloudWatch ServiceLens console. For more information, see What is X-Ray?

ExcludedPages
Type: Array of strings

A list of URLs in your website or application to exclude from RUM data collection.

You can't include both ExcludedPages and IncludedPages in the same operation.

FavoritePages
Type: Array of strings

A list of pages in your application that are to be displayed with a "favorite" icon in the CloudWatch RUM console.

GuestRoleArn
Type: string

The ARN of the guest IAM role that is attached to the Amazon Cognito identity pool that is used to authorize the sending of data to RUM.

It is possible that an app monitor does not have a value for GuestRoleArn. For example, this can happen when you use the console to create an app monitor and you allow CloudWatch RUM to create a new identity pool for Authorization. In this case, GuestRoleArn is not present in the GetAppMonitor response because it is not stored by the service.

If this issue affects you, you can take one of the following steps:

  • Use the Cloud Development Kit (CDK) to create an identity pool and the associated IAM role, and use that for your app monitor.

  • Make a separate GetIdentityPoolRoles call to Amazon Cognito to retrieve the GuestRoleArn.

IdentityPoolId
Type: string

The ID of the Amazon Cognito identity pool that is used to authorize the sending of data to RUM.

IncludedPages
Type: Array of strings

If this app monitor is to collect data from only certain pages in your application, this structure lists those pages.

You can't include both ExcludedPages and IncludedPages in the same operation.

SessionSampleRate
Type: double

Specifies the portion of user sessions to use for RUM data collection. Choosing a higher portion gives you more data but also incurs more costs.

The range for this value is 0 to 1 inclusive. Setting this to 1 means that 100% of user sessions are sampled, and setting it to 0.1 means that 10% of user sessions are sampled.

If you omit this parameter, the default of 0.1 is used, and 10% of sessions will be sampled.

Telemetries
Type: Array of strings

An array that lists the types of telemetry data that this app monitor is to collect.

  • errors indicates that RUM collects data about unhandled JavaScript errors raised by your application.

  • performance indicates that RUM collects performance data about how your application and its resources are loaded and rendered. This includes Core Web Vitals.

  • http indicates that RUM collects data about HTTP errors thrown by your application.

AppMonitorDetails

Description

A structure that contains information about the RUM app monitor.

Members
id
Type: string

The unique ID of the app monitor.

name
Type: string

The name of the app monitor.

version
Type: string

The version of the app monitor.

AppMonitorSummary

Description

A structure that includes some data about app monitors and their settings.

Members
Created
Type: string

The date and time that the app monitor was created.

Id
Type: string

The unique ID of this app monitor.

LastModified
Type: string

The date and time of the most recent changes to this app monitor's configuration.

Name
Type: string

The name of this app monitor.

State
Type: string

The current state of this app monitor.

BatchCreateRumMetricDefinitionsError

Description

A structure that defines one error caused by a BatchCreateRumMetricsDefinitions operation.

Members
ErrorCode
Required: Yes
Type: string

The error code.

ErrorMessage
Required: Yes
Type: string

The error message for this metric definition.

MetricDefinition
Required: Yes
Type: MetricDefinitionRequest structure

The metric definition that caused this error.

BatchDeleteRumMetricDefinitionsError

Description

A structure that defines one error caused by a BatchCreateRumMetricsDefinitions operation.

Members
ErrorCode
Required: Yes
Type: string

The error code.

ErrorMessage
Required: Yes
Type: string

The error message for this metric definition.

MetricDefinitionId
Required: Yes
Type: string

The ID of the metric definition that caused this error.

ConflictException

Description

This operation attempted to create a resource that already exists.

Members
message
Required: Yes
Type: string
resourceName
Required: Yes
Type: string

The name of the resource that is associated with the error.

resourceType
Type: string

The type of the resource that is associated with the error.

CustomEvents

Description

A structure that contains information about custom events for this app monitor.

Members
Status
Type: string

Specifies whether this app monitor allows the web client to define and send custom events. The default is for custom events to be DISABLED.

CwLog

Description

A structure that contains the information about whether the app monitor stores copies of the data that RUM collects in CloudWatch Logs. If it does, this structure also contains the name of the log group.

Members
CwLogEnabled
Type: boolean

Indicated whether the app monitor stores copies of the data that RUM collects in CloudWatch Logs.

CwLogGroup
Type: string

The name of the log group where the copies are stored.

DataStorage

Description

A structure that contains information about whether this app monitor stores a copy of the telemetry data that RUM collects using CloudWatch Logs.

Members
CwLog
Type: CwLog structure

A structure that contains the information about whether the app monitor stores copies of the data that RUM collects in CloudWatch Logs. If it does, this structure also contains the name of the log group.

InternalServerException

Description

Internal service exception.

Members
message
Required: Yes
Type: string
retryAfterSeconds
Type: int

The value of a parameter in the request caused an error.

MetricDefinition

Description

A structure that displays the definition of one extended metric that RUM sends to CloudWatch or CloudWatch Evidently. For more information, see Additional metrics that you can send to CloudWatch and CloudWatch Evidently.

Members
DimensionKeys
Type: Associative array of custom strings keys (DimensionKey) to strings

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 is CloudWatch. If the metric destination is Evidently, the value of DimensionKeys is ignored.

EventPattern
Type: string

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 in DimensionKeys, then the metric is published with the specified dimensions.

MetricDefinitionId
Required: Yes
Type: string

The ID of this metric definition.

Name
Required: Yes
Type: string

The name of the metric that is defined in this structure.

Namespace
Type: string

If 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.

UnitLabel
Type: string

Use this field only if you are sending this metric to CloudWatch. It defines the CloudWatch metric unit that this metric is measured in.

ValueKey
Type: string

The field within the event object that the metric value is sourced from.

MetricDefinitionRequest

Description

Use this structure to define one extended metric or custom metric that RUM will send to CloudWatch or CloudWatch Evidently. For more information, see Custom metrics and extended metrics that you can send to CloudWatch and CloudWatch Evidently.

This structure is validated differently for extended metrics and custom metrics. For extended metrics that are sent to the AWS/RUM namespace, the following validations apply:

  • The Namespace parameter must be omitted or set to AWS/RUM.

  • Only certain combinations of values for Name, ValueKey, and EventPattern are valid. In addition to what is displayed in the following list, the EventPattern can also include information used by the DimensionKeys field.

    • If Name is PerformanceNavigationDuration, then ValueKeymust be event_details.duration and the EventPattern must include {"event_type":["com.amazon.rum.performance_navigation_event"]}

    • If Name is PerformanceResourceDuration, then ValueKeymust be event_details.duration and the EventPattern must include {"event_type":["com.amazon.rum.performance_resource_event"]}

    • If Name is NavigationSatisfiedTransaction, then ValueKeymust be null and the EventPattern must include { "event_type": ["com.amazon.rum.performance_navigation_event"], "event_details": { "duration": [{ "numeric": [">",2000] }] } }

    • If Name is NavigationToleratedTransaction, then ValueKeymust be null and the EventPattern must include { "event_type": ["com.amazon.rum.performance_navigation_event"], "event_details": { "duration": [{ "numeric": [">=",2000,"<"8000] }] } }

    • If Name is NavigationFrustratedTransaction, then ValueKeymust be null and the EventPattern must include { "event_type": ["com.amazon.rum.performance_navigation_event"], "event_details": { "duration": [{ "numeric": [">=",8000] }] } }

    • If Name is WebVitalsCumulativeLayoutShift, then ValueKeymust be event_details.value and the EventPattern must include {"event_type":["com.amazon.rum.cumulative_layout_shift_event"]}

    • If Name is WebVitalsFirstInputDelay, then ValueKeymust be event_details.value and the EventPattern must include {"event_type":["com.amazon.rum.first_input_delay_event"]}

    • If Name is WebVitalsLargestContentfulPaint, then ValueKeymust be event_details.value and the EventPattern must include {"event_type":["com.amazon.rum.largest_contentful_paint_event"]}

    • If Name is JsErrorCount, then ValueKeymust be null and the EventPattern must include {"event_type":["com.amazon.rum.js_error_event"]}

    • If Name is HttpErrorCount, then ValueKeymust be null and the EventPattern must include {"event_type":["com.amazon.rum.http_event"]}

    • If Name is SessionCount, then ValueKeymust be null and the EventPattern must include {"event_type":["com.amazon.rum.session_start_event"]}

    • If Name is PageViewCount, then ValueKeymust be null and the EventPattern must include {"event_type":["com.amazon.rum.page_view_event"]}

    • If Name is Http4xxCount, then ValueKeymust be null and the EventPattern must include {"event_type": ["com.amazon.rum.http_event"],"event_details":{"response":{"status":[{"numeric":[">=",400,"<",500]}]}}} }

    • If Name is Http5xxCount, then ValueKeymust be null and the EventPattern must include {"event_type": ["com.amazon.rum.http_event"],"event_details":{"response":{"status":[{"numeric":[">=",500,"<=",599]}]}}} }

For custom metrics, the following validation rules apply:

  • The namespace can't be omitted and can't be AWS/RUM. You can use the AWS/RUM namespace only for extended metrics.

  • All dimensions listed in the DimensionKeys field must be present in the value of EventPattern.

  • The values that you specify for ValueKey, EventPattern, and DimensionKeys must be fields in RUM events, so all first-level keys in these fields must be one of the keys in the list later in this section.

  • If you set a value for EventPattern, it must be a JSON object.

  • For every non-empty event_details, there must be a non-empty event_type.

  • If EventPattern contains an event_details field, it must also contain an event_type. For every built-in event_type that you use, you must use a value for event_details that corresponds to that event_type. For information about event details that correspond to event types, see RUM event details.

  • In EventPattern, any JSON array must contain only one value.

Valid key values for first-level keys in the ValueKey, EventPattern, and DimensionKeys fields:

  • account_id

  • application_Id

  • application_version

  • application_name

  • batch_id

  • event_details

  • event_id

  • event_interaction

  • event_timestamp

  • event_type

  • event_version

  • log_stream

  • metadata

  • sessionId

  • user_details

  • userId

Members
DimensionKeys
Type: Associative array of custom strings keys (DimensionKey) to strings

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.

EventPattern
Type: 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.

Name
Required: Yes
Type: 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

Namespace
Type: 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.

UnitLabel
Type: string

The CloudWatch metric unit to use for this metric. If you omit this field, the metric is recorded with no unit.

ValueKey
Type: 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 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. Evidently will handle data extraction from the event.

MetricDestinationSummary

Description

A structure that displays information about one destination that CloudWatch RUM sends extended metrics to.

Members
Destination
Type: string

Specifies whether the destination is CloudWatch or Evidently.

DestinationArn
Type: string

If the destination is Evidently, this specifies the ARN of the Evidently experiment that receives the metrics.

IamRoleArn
Type: string

This field appears only when the destination is Evidently. It specifies the ARN of the IAM role that is used to write to the Evidently experiment that receives the metrics.

QueryFilter

Description

A structure that defines a key and values that you can use to filter the results. The only performance events that are returned are those that have values matching the ones that you specify in one of your QueryFilter structures.

For example, you could specify Browser as the Name and specify Chrome,Firefox as the Values to return events generated only from those browsers.

Specifying Invert as the Name works as a "not equal to" filter. For example, specify Invert as the Name and specify Chrome as the value to return all events except events from user sessions with the Chrome browser.

Members
Name
Type: string

The name of a key to search for. The filter returns only the events that match the Name and Values that you specify.

Valid values for Name are Browser | Device | Country | Page | OS | EventType | Invert

Values
Type: Array of strings

The values of the Name that are to be be included in the returned results.

ResourceNotFoundException

Description

Resource not found.

Members
message
Required: Yes
Type: string
resourceName
Required: Yes
Type: string

The name of the resource that is associated with the error.

resourceType
Type: string

The type of the resource that is associated with the error.

RumEvent

Description

A structure that contains the information for one performance event that RUM collects from a user session with your application.

Members
details
Required: Yes
Type: string (string|number|array|map or anything parsable by json_encode)

A string containing details about the event.

id
Required: Yes
Type: string

A unique ID for this event.

metadata
Type: string (string|number|array|map or anything parsable by json_encode)

Metadata about this event, which contains a JSON serialization of the identity of the user for this session. The user information comes from information such as the HTTP user-agent request header and document interface.

timestamp
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The exact time that this event occurred.

type
Required: Yes
Type: string

The JSON schema that denotes the type of event this is, such as a page load or a new session.

ServiceQuotaExceededException

Description

This request exceeds a service quota.

Members
message
Required: Yes
Type: string

ThrottlingException

Description

The request was throttled because of quota limits.

Members
message
Required: Yes
Type: string
quotaCode
Type: string

The ID of the service quota that was exceeded.

retryAfterSeconds
Type: int

The value of a parameter in the request caused an error.

serviceCode
Type: string

The ID of the service that is associated with the error.

TimeRange

Description

A structure that defines the time range that you want to retrieve results from.

Members
After
Required: Yes
Type: long (int|float)

The beginning of the time range to retrieve performance events from.

Before
Type: long (int|float)

The end of the time range to retrieve performance events from. If you omit this, the time range extends to the time that this operation is performed.

UserDetails

Description

A structure that contains information about the user session that this batch of events was collected from.

Members
sessionId
Type: string

The session ID that the performance events are from.

userId
Type: string

The ID of the user for this user session. This ID is generated by RUM and does not include any personally identifiable information about the user.

ValidationException

Description

One of the arguments for the request is not valid.

Members
message
Required: Yes
Type: string