CloudWatchRUM

Table of Contents

Client

class CloudWatchRUM.Client

A low-level client representing CloudWatch RUM

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.

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.

import boto3

client = boto3.client('rum')

These are the available methods:

batch_create_rum_metric_definitions(**kwargs)

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 or custom metrics or both.

  • Extended metrics enable you to send metrics with additional dimensions not included in the default metrics. You can also send extended metrics to Evidently as well as 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 or to CloudWatch Evidently or to both. With custom metrics, you can use any metric name and namespace, and 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.

See also: AWS API Documentation

Request Syntax

response = client.batch_create_rum_metric_definitions(
    AppMonitorName='string',
    Destination='CloudWatch'|'Evidently',
    DestinationArn='string',
    MetricDefinitions=[
        {
            'DimensionKeys': {
                'string': 'string'
            },
            'EventPattern': 'string',
            'Name': 'string',
            'Namespace': 'string',
            'UnitLabel': 'string',
            'ValueKey': 'string'
        },
    ]
)
Parameters
  • AppMonitorName (string) --

    [REQUIRED]

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

  • Destination (string) --

    [REQUIRED]

    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 (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 (list) --

    [REQUIRED]

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

    • (dict) --

      Use this structure to define one extended metric or custom metric that RUM will send to CloudWatch or CloudWatch Evidently. For more information, see Additional 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 list below, the EventPattern can also include information used by the DimensionKeys field.
        • If Name is PerformanceNavigationDuration , then ValueKey must be event_details.duration and the EventPattern must include {"event_type":["com.amazon.rum.performance_navigation_event"]}
        • If Name is PerformanceResourceDuration , then ValueKey must be event_details.duration and the EventPattern must include {"event_type":["com.amazon.rum.performance_resource_event"]}
        • If Name is NavigationSatisfiedTransaction , then ValueKey must 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 ValueKey must 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 ValueKey must 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 ValueKey must be event_details.value and the EventPattern must include {"event_type":["com.amazon.rum.cumulative_layout_shift_event"]}
        • If Name is WebVitalsFirstInputDelay , then ValueKey must be event_details.value and the EventPattern must include {"event_type":["com.amazon.rum.first_input_delay_event"]}
        • If Name is WebVitalsLargestContentfulPaint , then ValueKey must be event_details.value and the EventPattern must include {"event_type":["com.amazon.rum.largest_contentful_paint_event"]}
        • If Name is JsErrorCount , then ValueKey must be null and the EventPattern must include {"event_type":["com.amazon.rum.js_error_event"]}
        • If Name is HttpErrorCount , then ValueKey must be null and the EventPattern must include {"event_type":["com.amazon.rum.http_event"]}
        • If Name is SessionCount , then ValueKey must be null and the EventPattern must include {"event_type":["com.amazon.rum.session_start_event"]}

      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
      • DimensionKeys (dict) --

        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 .

        • (string) --
          • (string) --
      • EventPattern (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 (string) -- [REQUIRED]

        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 (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 (string) --

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

      • ValueKey (string) --

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

        If you omit this field, a hardcoded value of 1 is pushed as the metric value. This is useful if you just want to count the number of events that the filter catches.

        If this metric is sent to CloudWatch Evidently, this field will be passed to Evidently raw and Evidently will handle data extraction from the event.

Return type

dict

Returns

Response Syntax

{
    'Errors': [
        {
            'ErrorCode': 'string',
            'ErrorMessage': 'string',
            'MetricDefinition': {
                'DimensionKeys': {
                    'string': 'string'
                },
                'EventPattern': 'string',
                'Name': 'string',
                'Namespace': 'string',
                'UnitLabel': 'string',
                'ValueKey': 'string'
            }
        },
    ],
    'MetricDefinitions': [
        {
            'DimensionKeys': {
                'string': 'string'
            },
            'EventPattern': 'string',
            'MetricDefinitionId': 'string',
            'Name': 'string',
            'Namespace': 'string',
            'UnitLabel': 'string',
            'ValueKey': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Errors (list) --

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

      • (dict) --

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

        • ErrorCode (string) --

          The error code.

        • ErrorMessage (string) --

          The error message for this metric definition.

        • MetricDefinition (dict) --

          The metric definition that caused this error.

          • DimensionKeys (dict) --

            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 .

            • (string) --
              • (string) --
          • EventPattern (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 (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 (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 (string) --

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

          • ValueKey (string) --

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

            If you omit this field, a hardcoded value of 1 is pushed as the metric value. This is useful if you just want to count the number of events that the filter catches.

            If this metric is sent to CloudWatch Evidently, this field will be passed to Evidently raw and Evidently will handle data extraction from the event.

    • MetricDefinitions (list) --

      An array of structures that define the extended metrics.

      • (dict) --

        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.

        • DimensionKeys (dict) --

          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.

          • (string) --
            • (string) --
        • EventPattern (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 (string) --

          The ID of this metric definition.

        • Name (string) --

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

        • Namespace (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 (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 (string) --

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

Exceptions

  • CloudWatchRUM.Client.exceptions.ConflictException
  • CloudWatchRUM.Client.exceptions.ServiceQuotaExceededException
  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
batch_delete_rum_metric_definitions(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.batch_delete_rum_metric_definitions(
    AppMonitorName='string',
    Destination='CloudWatch'|'Evidently',
    DestinationArn='string',
    MetricDefinitionIds=[
        'string',
    ]
)
Parameters
  • AppMonitorName (string) --

    [REQUIRED]

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

  • Destination (string) --

    [REQUIRED]

    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 (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 (list) --

    [REQUIRED]

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

    • (string) --
Return type

dict

Returns

Response Syntax

{
    'Errors': [
        {
            'ErrorCode': 'string',
            'ErrorMessage': 'string',
            'MetricDefinitionId': 'string'
        },
    ],
    'MetricDefinitionIds': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • Errors (list) --

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

      • (dict) --

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

        • ErrorCode (string) --

          The error code.

        • ErrorMessage (string) --

          The error message for this metric definition.

        • MetricDefinitionId (string) --

          The ID of the metric definition that caused this error.

    • MetricDefinitionIds (list) --

      The IDs of the metric definitions that were deleted.

      • (string) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ConflictException
  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
batch_get_rum_metric_definitions(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.batch_get_rum_metric_definitions(
    AppMonitorName='string',
    Destination='CloudWatch'|'Evidently',
    DestinationArn='string',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • AppMonitorName (string) --

    [REQUIRED]

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

  • Destination (string) --

    [REQUIRED]

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

  • DestinationArn (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 (integer) --

    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 (string) -- Use the token returned by the previous operation to request the next page of results.
Return type

dict

Returns

Response Syntax

{
    'MetricDefinitions': [
        {
            'DimensionKeys': {
                'string': 'string'
            },
            'EventPattern': 'string',
            'MetricDefinitionId': 'string',
            'Name': 'string',
            'Namespace': 'string',
            'UnitLabel': 'string',
            'ValueKey': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • MetricDefinitions (list) --

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

      • (dict) --

        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.

        • DimensionKeys (dict) --

          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.

          • (string) --
            • (string) --
        • EventPattern (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 (string) --

          The ID of this metric definition.

        • Name (string) --

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

        • Namespace (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 (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 (string) --

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

    • NextToken (string) --

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

Exceptions

  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
close()

Closes underlying endpoint connections.

create_app_monitor(**kwargs)

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?

See also: AWS API Documentation

Request Syntax

response = client.create_app_monitor(
    AppMonitorConfiguration={
        'AllowCookies': True|False,
        'EnableXRay': True|False,
        'ExcludedPages': [
            'string',
        ],
        'FavoritePages': [
            'string',
        ],
        'GuestRoleArn': 'string',
        'IdentityPoolId': 'string',
        'IncludedPages': [
            'string',
        ],
        'SessionSampleRate': 123.0,
        'Telemetries': [
            'errors'|'performance'|'http',
        ]
    },
    CustomEvents={
        'Status': 'ENABLED'|'DISABLED'
    },
    CwLogEnabled=True|False,
    Domain='string',
    Name='string',
    Tags={
        'string': 'string'
    }
)
Parameters
  • AppMonitorConfiguration (dict) --

    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 (list) --

      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.

      • (string) --
    • FavoritePages (list) --

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

      • (string) --
    • 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 (list) --

      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.

      • (string) --
    • SessionSampleRate (float) --

      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 (list) --

      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.
      • (string) --
  • CustomEvents (dict) --

    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.

    • Status (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 .

  • 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) --

    [REQUIRED]

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

  • Name (string) --

    [REQUIRED]

    A name for the app monitor.

  • Tags (dict) --

    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.

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{
    'Id': 'string'
}

Response Structure

  • (dict) --

    • Id (string) --

      The unique ID of the new app monitor.

Exceptions

  • CloudWatchRUM.Client.exceptions.ConflictException
  • CloudWatchRUM.Client.exceptions.ServiceQuotaExceededException
  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
delete_app_monitor(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.delete_app_monitor(
    Name='string'
)
Parameters
Name (string) --

[REQUIRED]

The name of the app monitor to delete.

Return type
dict
Returns
Response Syntax
{}

Response Structure

  • (dict) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ConflictException
  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
delete_rum_metrics_destination(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.delete_rum_metrics_destination(
    AppMonitorName='string',
    Destination='CloudWatch'|'Evidently',
    DestinationArn='string'
)
Parameters
  • AppMonitorName (string) --

    [REQUIRED]

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

  • Destination (string) --

    [REQUIRED]

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

  • DestinationArn (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.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ConflictException
  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
get_app_monitor(**kwargs)

Retrieves the complete configuration information for one app monitor.

See also: AWS API Documentation

Request Syntax

response = client.get_app_monitor(
    Name='string'
)
Parameters
Name (string) --

[REQUIRED]

The app monitor to retrieve information for.

Return type
dict
Returns
Response Syntax
{
    'AppMonitor': {
        'AppMonitorConfiguration': {
            'AllowCookies': True|False,
            'EnableXRay': True|False,
            'ExcludedPages': [
                'string',
            ],
            'FavoritePages': [
                'string',
            ],
            'GuestRoleArn': 'string',
            'IdentityPoolId': 'string',
            'IncludedPages': [
                'string',
            ],
            'SessionSampleRate': 123.0,
            'Telemetries': [
                'errors'|'performance'|'http',
            ]
        },
        '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': 'string'
        }
    }
}

Response Structure

  • (dict) --
    • AppMonitor (dict) --

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

      • AppMonitorConfiguration (dict) --

        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 (list) --

          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.

          • (string) --
        • FavoritePages (list) --

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

          • (string) --
        • 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 (list) --

          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.

          • (string) --
        • SessionSampleRate (float) --

          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 (list) --

          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.
          • (string) --
      • Created (string) --

        The date and time that this app monitor was created.

      • CustomEvents (dict) --

        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.

        • Status (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 .

      • DataStorage (dict) --

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

        • CwLog (dict) --

          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.

      • Tags (dict) --

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

        • (string) --
          • (string) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
get_app_monitor_data(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.get_app_monitor_data(
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    Name='string',
    NextToken='string',
    TimeRange={
        'After': 123,
        'Before': 123
    }
)
Parameters
  • Filters (list) --

    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.

    • (dict) --

      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.

      • 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 (list) --

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

        • (string) --
  • MaxResults (integer) -- The maximum number of results to return in one operation.
  • Name (string) --

    [REQUIRED]

    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 (dict) --

    [REQUIRED]

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

    • After (integer) -- [REQUIRED]

      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.

Return type

dict

Returns

Response Syntax

{
    'Events': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Events (list) --

      The events that RUM collected that match your request.

      • (string) --
    • NextToken (string) --

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

Exceptions

  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
list_app_monitors(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.list_app_monitors(
    MaxResults=123,
    NextToken='string'
)
Parameters
  • MaxResults (integer) -- The maximum number of results to return in one operation. The default is 50. The maximum that you can specify is 100.
  • NextToken (string) -- Use the token returned by the previous operation to request the next page of results.
Return type

dict

Returns

Response Syntax

{
    'AppMonitorSummaries': [
        {
            'Created': 'string',
            'Id': 'string',
            'LastModified': 'string',
            'Name': 'string',
            'State': 'CREATED'|'DELETING'|'ACTIVE'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • AppMonitorSummaries (list) --

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

      • (dict) --

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

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

    • NextToken (string) --

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

Exceptions

  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
list_rum_metrics_destinations(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.list_rum_metrics_destinations(
    AppMonitorName='string',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • AppMonitorName (string) --

    [REQUIRED]

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

  • MaxResults (integer) --

    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 (string) -- Use the token returned by the previous operation to request the next page of results.
Return type

dict

Returns

Response Syntax

{
    'Destinations': [
        {
            'Destination': 'CloudWatch'|'Evidently',
            'DestinationArn': 'string',
            'IamRoleArn': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Destinations (list) --

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

      • (dict) --

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

        • Destination (string) --

          Specifies whether the destination is CloudWatch or Evidently .

        • DestinationArn (string) --

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

        • IamRoleArn (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.

    • NextToken (string) --

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

Exceptions

  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
list_tags_for_resource(**kwargs)

Displays the tags associated with a CloudWatch RUM resource.

See also: AWS API Documentation

Request Syntax

response = client.list_tags_for_resource(
    ResourceArn='string'
)
Parameters
ResourceArn (string) --

[REQUIRED]

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

Return type
dict
Returns
Response Syntax
{
    'ResourceArn': 'string',
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --
    • ResourceArn (string) --

      The ARN of the resource that you are viewing.

    • Tags (dict) --

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

      • (string) --
        • (string) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
put_rum_events(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.put_rum_events(
    AppMonitorDetails={
        'id': 'string',
        'name': 'string',
        'version': 'string'
    },
    BatchId='string',
    Id='string',
    RumEvents=[
        {
            'details': 'string',
            'id': 'string',
            'metadata': 'string',
            'timestamp': datetime(2015, 1, 1),
            'type': 'string'
        },
    ],
    UserDetails={
        'sessionId': 'string',
        'userId': 'string'
    }
)
Parameters
  • AppMonitorDetails (dict) --

    [REQUIRED]

    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) --

    [REQUIRED]

    A unique identifier for this batch of RUM event data.

  • Id (string) --

    [REQUIRED]

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

  • RumEvents (list) --

    [REQUIRED]

    An array of structures that contain the telemetry event data.

    • (dict) --

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

      • details (string) -- [REQUIRED]

        A string containing details about the event.

      • id (string) -- [REQUIRED]

        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.

      • timestamp (datetime) -- [REQUIRED]

        The exact time that this event occurred.

      • type (string) -- [REQUIRED]

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

  • UserDetails (dict) --

    [REQUIRED]

    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.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
put_rum_metrics_destination(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.put_rum_metrics_destination(
    AppMonitorName='string',
    Destination='CloudWatch'|'Evidently',
    DestinationArn='string',
    IamRoleArn='string'
)
Parameters
  • AppMonitorName (string) --

    [REQUIRED]

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

  • Destination (string) --

    [REQUIRED]

    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 (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 (string) --

    This parameter is required if Destination is Evidently . If Destination is CloudWatch , do not 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.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ConflictException
  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
tag_resource(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.tag_resource(
    ResourceArn='string',
    Tags={
        'string': 'string'
    }
)
Parameters
  • ResourceArn (string) --

    [REQUIRED]

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

  • Tags (dict) --

    [REQUIRED]

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

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
untag_resource(**kwargs)

Removes one or more tags from the specified resource.

See also: AWS API Documentation

Request Syntax

response = client.untag_resource(
    ResourceArn='string',
    TagKeys=[
        'string',
    ]
)
Parameters
  • ResourceArn (string) --

    [REQUIRED]

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

  • TagKeys (list) --

    [REQUIRED]

    The list of tag keys to remove from the resource.

    • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
update_app_monitor(**kwargs)

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?

See also: AWS API Documentation

Request Syntax

response = client.update_app_monitor(
    AppMonitorConfiguration={
        'AllowCookies': True|False,
        'EnableXRay': True|False,
        'ExcludedPages': [
            'string',
        ],
        'FavoritePages': [
            'string',
        ],
        'GuestRoleArn': 'string',
        'IdentityPoolId': 'string',
        'IncludedPages': [
            'string',
        ],
        'SessionSampleRate': 123.0,
        'Telemetries': [
            'errors'|'performance'|'http',
        ]
    },
    CustomEvents={
        'Status': 'ENABLED'|'DISABLED'
    },
    CwLogEnabled=True|False,
    Domain='string',
    Name='string'
)
Parameters
  • AppMonitorConfiguration (dict) --

    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 (list) --

      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.

      • (string) --
    • FavoritePages (list) --

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

      • (string) --
    • 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 (list) --

      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.

      • (string) --
    • SessionSampleRate (float) --

      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 (list) --

      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.
      • (string) --
  • CustomEvents (dict) --

    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.

    • Status (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 .

  • 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) --

    [REQUIRED]

    The name of the app monitor to update.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ConflictException
  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException
update_rum_metric_definition(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.update_rum_metric_definition(
    AppMonitorName='string',
    Destination='CloudWatch'|'Evidently',
    DestinationArn='string',
    MetricDefinition={
        'DimensionKeys': {
            'string': 'string'
        },
        'EventPattern': 'string',
        'Name': 'string',
        'Namespace': 'string',
        'UnitLabel': 'string',
        'ValueKey': 'string'
    },
    MetricDefinitionId='string'
)
Parameters
  • AppMonitorName (string) --

    [REQUIRED]

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

  • Destination (string) --

    [REQUIRED]

    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 (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 (dict) --

    [REQUIRED]

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

    • DimensionKeys (dict) --

      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 .

      • (string) --
        • (string) --
    • EventPattern (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 (string) -- [REQUIRED]

      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 (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 (string) --

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

    • ValueKey (string) --

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

      If you omit this field, a hardcoded value of 1 is pushed as the metric value. This is useful if you just want to count the number of events that the filter catches.

      If this metric is sent to CloudWatch Evidently, this field will be passed to Evidently raw and Evidently will handle data extraction from the event.

  • MetricDefinitionId (string) --

    [REQUIRED]

    The ID of the metric definition to update.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • CloudWatchRUM.Client.exceptions.ConflictException
  • CloudWatchRUM.Client.exceptions.ServiceQuotaExceededException
  • CloudWatchRUM.Client.exceptions.ResourceNotFoundException
  • CloudWatchRUM.Client.exceptions.InternalServerException
  • CloudWatchRUM.Client.exceptions.ValidationException
  • CloudWatchRUM.Client.exceptions.ThrottlingException
  • CloudWatchRUM.Client.exceptions.AccessDeniedException

Paginators

The available paginators are:

class CloudWatchRUM.Paginator.BatchGetRumMetricDefinitions
paginator = client.get_paginator('batch_get_rum_metric_definitions')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CloudWatchRUM.Client.batch_get_rum_metric_definitions().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    AppMonitorName='string',
    Destination='CloudWatch'|'Evidently',
    DestinationArn='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • AppMonitorName (string) --

    [REQUIRED]

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

  • Destination (string) --

    [REQUIRED]

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

  • DestinationArn (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.

  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'MetricDefinitions': [
        {
            'DimensionKeys': {
                'string': 'string'
            },
            'EventPattern': 'string',
            'MetricDefinitionId': 'string',
            'Name': 'string',
            'Namespace': 'string',
            'UnitLabel': 'string',
            'ValueKey': 'string'
        },
    ],

}

Response Structure

  • (dict) --

    • MetricDefinitions (list) --

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

      • (dict) --

        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.

        • DimensionKeys (dict) --

          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.

          • (string) --
            • (string) --
        • EventPattern (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 (string) --

          The ID of this metric definition.

        • Name (string) --

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

        • Namespace (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 (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 (string) --

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

class CloudWatchRUM.Paginator.GetAppMonitorData
paginator = client.get_paginator('get_app_monitor_data')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CloudWatchRUM.Client.get_app_monitor_data().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    Name='string',
    TimeRange={
        'After': 123,
        'Before': 123
    },
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • Filters (list) --

    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.

    • (dict) --

      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.

      • 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 (list) --

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

        • (string) --
  • Name (string) --

    [REQUIRED]

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

  • TimeRange (dict) --

    [REQUIRED]

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

    • After (integer) -- [REQUIRED]

      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.

  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'Events': [
        'string',
    ],

}

Response Structure

  • (dict) --

    • Events (list) --

      The events that RUM collected that match your request.

      • (string) --

class CloudWatchRUM.Paginator.ListAppMonitors
paginator = client.get_paginator('list_app_monitors')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CloudWatchRUM.Client.list_app_monitors().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
PaginationConfig (dict) --

A dictionary that provides parameters to control pagination.

  • MaxItems (integer) --

    The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

  • PageSize (integer) --

    The size of each page.

  • StartingToken (string) --

    A token to specify where to start paginating. This is the NextToken from a previous response.

Return type
dict
Returns
Response Syntax
{
    'AppMonitorSummaries': [
        {
            'Created': 'string',
            'Id': 'string',
            'LastModified': 'string',
            'Name': 'string',
            'State': 'CREATED'|'DELETING'|'ACTIVE'
        },
    ],

}

Response Structure

  • (dict) --
    • AppMonitorSummaries (list) --

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

      • (dict) --

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

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

class CloudWatchRUM.Paginator.ListRumMetricsDestinations
paginator = client.get_paginator('list_rum_metrics_destinations')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CloudWatchRUM.Client.list_rum_metrics_destinations().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    AppMonitorName='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • AppMonitorName (string) --

    [REQUIRED]

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

  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'Destinations': [
        {
            'Destination': 'CloudWatch'|'Evidently',
            'DestinationArn': 'string',
            'IamRoleArn': 'string'
        },
    ],

}

Response Structure

  • (dict) --

    • Destinations (list) --

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

      • (dict) --

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

        • Destination (string) --

          Specifies whether the destination is CloudWatch or Evidently .

        • DestinationArn (string) --

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

        • IamRoleArn (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.