You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

Class: AWS.RUM

Inherits:
AWS.Service show all
Identifier:
rum
API Version:
2018-05-10
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

With Amazon CloudWatch RUM, you can perform real-user monitoring to collect client-side data about your web application performance from actual user sessions in real time. The data collected includes page load times, client-side errors, and user behavior. When you view this data, you can see it all aggregated together and also see breakdowns by the browsers and devices that your customers use.

 <p>You can use the collected data to quickly identify and debug client-side performance issues. CloudWatch RUM helps you visualize anomalies in your application performance and find relevant debugging data such as error messages, stack traces, and user sessions. You can also use RUM to understand the range of end-user impact including the number of users, geolocations, and browsers used.</p> 

Sending a Request Using RUM

var rum = new AWS.RUM();
rum.createAppMonitor(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the RUM object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var rum = new AWS.RUM({apiVersion: '2018-05-10'});

You can also set the API version globally in AWS.config.apiVersions using the rum service identifier:

AWS.config.apiVersions = {
  rum: '2018-05-10',
  // other service API versions
};

var rum = new AWS.RUM();

Version:

  • 2018-05-10

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.RUM(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a RUM object

var rum = new AWS.RUM({apiVersion: '2018-05-10'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.RUM.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.RUM.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.RUM.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

  • useFipsEndpoint (Boolean)

    Enables FIPS compatible endpoints. Defaults to false.

  • useDualstackEndpoint (Boolean)

    Enables IPv6 dualstack endpoint. Defaults to false.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

createAppMonitor(params = {}, callback) ⇒ AWS.Request

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?

Service Reference:

Examples:

Calling the createAppMonitor operation

var params = {
  Domain: 'STRING_VALUE', /* required */
  Name: 'STRING_VALUE', /* required */
  AppMonitorConfiguration: {
    AllowCookies: true || false,
    EnableXRay: true || false,
    ExcludedPages: [
      'STRING_VALUE',
      /* more items */
    ],
    FavoritePages: [
      'STRING_VALUE',
      /* more items */
    ],
    GuestRoleArn: 'STRING_VALUE',
    IdentityPoolId: 'STRING_VALUE',
    IncludedPages: [
      'STRING_VALUE',
      /* more items */
    ],
    SessionSampleRate: 'NUMBER_VALUE',
    Telemetries: [
      errors | performance | http,
      /* more items */
    ]
  },
  CwLogEnabled: true || false,
  Tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
rum.createAppMonitor(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppMonitorConfiguration — (map)

      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.

      • AllowCookies — (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 — (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 — (Array<String>)

        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 — (Array<String>)

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

      • GuestRoleArn — (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 — (String)

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

      • IncludedPages — (Array<String>)

        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 — (Float)

        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 — (Array<String>)

        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.

    • CwLogEnabled — (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 — (String)

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

    • Name — (String)

      A name for the app monitor.

    • Tags — (map<String>)

      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&#95;tagging.html&quot;&gt;Tagging Amazon Web Services resources</a>.</p> 

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Id — (String)

        The unique ID of the new app monitor.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteAppMonitor(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

Calling the deleteAppMonitor operation

var params = {
  Name: 'STRING_VALUE' /* required */
};
rum.deleteAppMonitor(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Name — (String)

      The name of the app monitor to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getAppMonitor(params = {}, callback) ⇒ AWS.Request

Retrieves the complete configuration information for one app monitor.

Service Reference:

Examples:

Calling the getAppMonitor operation

var params = {
  Name: 'STRING_VALUE' /* required */
};
rum.getAppMonitor(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Name — (String)

      The app monitor to retrieve information for.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppMonitor — (map)

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

        • AppMonitorConfiguration — (map)

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

          • AllowCookies — (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 — (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 — (Array<String>)

            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 — (Array<String>)

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

          • GuestRoleArn — (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 — (String)

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

          • IncludedPages — (Array<String>)

            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 — (Float)

            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 — (Array<String>)

            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.

        • Created — (String)

          The date and time that this app monitor was created.

        • DataStorage — (map)

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

          • CwLog — (map)

            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.

            • CwLogEnabled — (Boolean)

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

            • CwLogGroup — (String)

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

        • Domain — (String)

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

        • Id — (String)

          The unique ID of this app monitor.

        • LastModified — (String)

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

        • Name — (String)

          The name of the app monitor.

        • State — (String)

          The current state of the app monitor.

          Possible values include:
          • "CREATED"
          • "DELETING"
          • "ACTIVE"
        • Tags — (map<String>)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getAppMonitorData(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the getAppMonitorData operation

var params = {
  Name: 'STRING_VALUE', /* required */
  TimeRange: { /* required */
    After: 'NUMBER_VALUE', /* required */
    Before: 'NUMBER_VALUE'
  },
  Filters: [
    {
      Name: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ],
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
rum.getAppMonitorData(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Filters — (Array<map>)

      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.

      • Name — (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 — (Array<String>)

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

    • MaxResults — (Integer)

      The maximum number of results to return in one operation.

    • Name — (String)

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

    • NextToken — (String)

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

    • TimeRange — (map)

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

      • Afterrequired — (Integer)

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

      • Before — (Integer)

        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.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Events — (Array<String>)

        The events that RUM collected that match your request.

      • NextToken — (String)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listAppMonitors(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

Calling the listAppMonitors operation

var params = {
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
rum.listAppMonitors(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • MaxResults — (Integer)

      The maximum number of results to return in one operation.

    • NextToken — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AppMonitorSummaries — (Array<map>)

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

        • Created — (String)

          The date and time that the app monitor was created.

        • Id — (String)

          The unique ID of this app monitor.

        • LastModified — (String)

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

        • Name — (String)

          The name of this app monitor.

        • State — (String)

          The current state of this app monitor.

          Possible values include:
          • "CREATED"
          • "DELETING"
          • "ACTIVE"
      • NextToken — (String)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTagsForResource(params = {}, callback) ⇒ AWS.Request

Displays the tags associated with a CloudWatch RUM resource.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  ResourceArn: 'STRING_VALUE' /* required */
};
rum.listTagsForResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceArn — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ResourceArn — (String)

        The ARN of the resource that you are viewing.

      • Tags — (map<String>)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putRumEvents(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the putRumEvents operation

var params = {
  AppMonitorDetails: { /* required */
    id: 'STRING_VALUE',
    name: 'STRING_VALUE',
    version: 'STRING_VALUE'
  },
  BatchId: 'STRING_VALUE', /* required */
  Id: 'STRING_VALUE', /* required */
  RumEvents: [ /* required */
    {
      details: any /* This value will be JSON encoded on your behalf with JSON.stringify() */, /* required */
      id: 'STRING_VALUE', /* required */
      timestamp: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
      type: 'STRING_VALUE', /* required */
      metadata: any /* This value will be JSON encoded on your behalf with JSON.stringify() */
    },
    /* more items */
  ],
  UserDetails: { /* required */
    sessionId: 'STRING_VALUE',
    userId: 'STRING_VALUE'
  }
};
rum.putRumEvents(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppMonitorDetails — (map)

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

      • id — (String)

        The unique ID of the app monitor.

      • name — (String)

        The name of the app monitor.

      • version — (String)

        The version of the app monitor.

    • BatchId — (String)

      A unique identifier for this batch of RUM event data.

    • Id — (String)

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

    • RumEvents — (Array<map>)

      An array of structures that contain the telemetry event data.

      • detailsrequired — (String)

        A string containing details about the event.

      • idrequired — (String)

        A unique ID for this event.

      • metadata — (String)

        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.

      • timestamprequired — (Date)

        The exact time that this event occurred.

      • typerequired — (String)

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

    • UserDetails — (map)

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

      • sessionId — (String)

        The session ID that the performance events are from.

      • userId — (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.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

tagResource(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  ResourceArn: 'STRING_VALUE', /* required */
  Tags: { /* required */
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
rum.tagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceArn — (String)

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

    • Tags — (map<String>)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

untagResource(params = {}, callback) ⇒ AWS.Request

Removes one or more tags from the specified resource.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  ResourceArn: 'STRING_VALUE', /* required */
  TagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
rum.untagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceArn — (String)

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

    • TagKeys — (Array<String>)

      The list of tag keys to remove from the resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateAppMonitor(params = {}, callback) ⇒ AWS.Request

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?

Service Reference:

Examples:

Calling the updateAppMonitor operation

var params = {
  Name: 'STRING_VALUE', /* required */
  AppMonitorConfiguration: {
    AllowCookies: true || false,
    EnableXRay: true || false,
    ExcludedPages: [
      'STRING_VALUE',
      /* more items */
    ],
    FavoritePages: [
      'STRING_VALUE',
      /* more items */
    ],
    GuestRoleArn: 'STRING_VALUE',
    IdentityPoolId: 'STRING_VALUE',
    IncludedPages: [
      'STRING_VALUE',
      /* more items */
    ],
    SessionSampleRate: 'NUMBER_VALUE',
    Telemetries: [
      errors | performance | http,
      /* more items */
    ]
  },
  CwLogEnabled: true || false,
  Domain: 'STRING_VALUE'
};
rum.updateAppMonitor(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • AppMonitorConfiguration — (map)

      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.

      • AllowCookies — (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 — (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 — (Array<String>)

        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 — (Array<String>)

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

      • GuestRoleArn — (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 — (String)

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

      • IncludedPages — (Array<String>)

        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 — (Float)

        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 — (Array<String>)

        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.

    • CwLogEnabled — (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 — (String)

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

    • Name — (String)

      The name of the app monitor to update.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.