CloudWatch RUM 2018-05-10
- 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 */)
.
- 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.
- 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.
- 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.
- 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.
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:
Operations
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>', ...], ], '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.
- 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.
<p>You can associate as many as 50 tags with an app monitor.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
Result Syntax
[ 'Id' => '<string>', ]
Result Details
Errors
-
This operation attempted to create a resource that already exists.
-
ServiceQuotaExceededException:
This request exceeds a service quota.
-
Internal service exception.
-
One of the arguments for the request is not valid.
-
The request was throttled because of quota limits.
-
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
Result Syntax
[]
Result Details
Errors
-
This operation attempted to create a resource that already exists.
-
Resource not found.
-
Internal service exception.
-
One of the arguments for the request is not valid.
-
The request was throttled because of quota limits.
-
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
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>', '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
-
Resource not found.
-
Internal service exception.
-
One of the arguments for the request is not valid.
-
The request was throttled because of quota limits.
-
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
Errors
-
Resource not found.
-
Internal service exception.
-
One of the arguments for the request is not valid.
-
The request was throttled because of quota limits.
-
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
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
-
Internal service exception.
-
One of the arguments for the request is not valid.
-
The request was throttled because of quota limits.
-
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
Result Syntax
[ 'ResourceArn' => '<string>', 'Tags' => ['<string>', ...], ]
Result Details
Members
Errors
-
Resource not found.
-
Internal service exception.
-
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
Errors
-
Resource not found.
-
Internal service exception.
-
One of the arguments for the request is not valid.
-
The request was throttled because of quota limits.
-
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
Result Syntax
[]
Result Details
Errors
-
Resource not found.
-
Internal service exception.
-
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
Result Syntax
[]
Result Details
Errors
-
Resource not found.
-
Internal service exception.
-
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>', ...], ], '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. - 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
Errors
-
This operation attempted to create a resource that already exists.
-
Resource not found.
-
Internal service exception.
-
One of the arguments for the request is not valid.
-
The request was throttled because of quota limits.
-
You don't have sufficient permissions to perform this action.
Shapes
AccessDeniedException
Description
You don't have sufficient permissions to perform this action.
Members
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.
- 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
andIncludedPages
in the same operation. - FavoritePages
-
- Type: Array of strings
A list of pages in the CloudWatch RUM console that are to be displayed with a "favorite" icon.
- 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.
- 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.
<p>You can't include both <code>ExcludedPages</code> and <code>IncludedPages</code> in the same operation.</p>
- SessionSampleRate
-
- Type: double
Specifies the percentage of user sessions to use for RUM data collection. Choosing a higher percentage gives you more data but also incurs more costs.
The number you specify is the percentage of user sessions that will be used.
If you omit this parameter, the default of 10 is used.
- 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
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.
ConflictException
Description
This operation attempted to create a resource that already exists.
Members
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
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
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
andValues
that you specify.Valid values for
Name
areBrowser
|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
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
ThrottlingException
Description
The request was throttled because of quota limits.
Members
TimeRange
Description
A structure that defines the time range that you want to retrieve results from.
Members
UserDetails
Description
A structure that contains information about the user session that this batch of events was collected from.