Skip to content

update_app_monitor

update_app_monitor(
    name: AppMonitorName,
    *,
    config_overrides: Optional[RUMClientConfig] = None,
    domain: Optional[AppMonitorDomain] = None,
    domain_list: Optional[AppMonitorDomainList] = None,
    app_monitor_configuration: Optional[AppMonitorConfiguration] = None,
    cw_log_enabled: Optional[bool] = None,
    custom_events: Optional[CustomEvents] = None,
    deobfuscation_configuration: Optional[DeobfuscationConfiguration] = None,
) -> UpdateAppMonitorResponse

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?

Parameters:

  • name (AppMonitorName) –

    The name of the app monitor to update.

  • domain (Optional[AppMonitorDomain], default: None ) –

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

  • domain_list (Optional[AppMonitorDomainList], default: None ) –

    List the domain names for which your application has administrative authority. The UpdateAppMonitor allows either the domain or the domain list.

  • app_monitor_configuration (Optional[AppMonitorConfiguration], default: None ) –

    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.

  • cw_log_enabled (Optional[bool], default: None ) –

    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.

  • custom_events (Optional[CustomEvents], default: None ) –

    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.

  • deobfuscation_configuration (Optional[DeobfuscationConfiguration], default: None ) –

    A structure that contains the configuration for how an app monitor can deobfuscate stack traces.

Raises:

Source code in docs_src/capo_rum/_services/rum.py
def update_app_monitor(
    self,
    name: "capo_rum.types.app_monitor_name.AppMonitorName",
    *,
    config_overrides: Optional[RUMClientConfig] = None,
    domain: Optional["capo_rum.types.app_monitor_domain.AppMonitorDomain"] = None,
    domain_list: Optional[
        "capo_rum.types.app_monitor_domain_list.AppMonitorDomainList"
    ] = None,
    app_monitor_configuration: Optional[
        "capo_rum.types.app_monitor_configuration.AppMonitorConfiguration"
    ] = None,
    cw_log_enabled: Optional[bool] = None,
    custom_events: Optional["capo_rum.types.custom_events.CustomEvents"] = None,
    deobfuscation_configuration: Optional[
        "capo_rum.types.deobfuscation_configuration.DeobfuscationConfiguration"
    ] = None,
) -> "capo_rum.types.update_app_monitor_response.UpdateAppMonitorResponse":
    """<p>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.</p> <p>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 <a href="https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_TagResource.html">TagResource</a>.</p> <p>To create a new app monitor, use <a href="https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_CreateAppMonitor.html">CreateAppMonitor</a>.</p> <p>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 <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-find-code-snippet.html">How do I find a code snippet that I've already generated?</a> </p>

    Args:
        name: <p>The name of the app monitor to update.</p>
        domain: <p>The top-level internet domain name for which your application has administrative authority.</p>
        domain_list: <p> List the domain names for which your application has administrative authority. The <code>UpdateAppMonitor</code> allows either the domain or the domain list. </p>
        app_monitor_configuration: <p>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 <code>AppMonitorConfiguration</code>, you must set up your own authorization method. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-get-started-authorization.html">Authorize your application to send data to Amazon Web Services</a>.</p>
        cw_log_enabled: <p>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.</p>
        custom_events: <p>Specifies whether this app monitor allows the web client to define and send custom events. The default is for custom events to be <code>DISABLED</code>.</p> <p>For more information about custom events, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-events.html">Send custom events</a>.</p>
        deobfuscation_configuration: <p> A structure that contains the configuration for how an app monitor can deobfuscate stack traces. </p>

    Raises:
        capo_rum.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
        capo_rum.errors.conflict_exception.ConflictException: <p>This operation attempted to create a resource that already exists.</p>
        capo_rum.errors.internal_server_exception.InternalServerException: <p>Internal service exception.</p>
        capo_rum.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found.</p>
        capo_rum.errors.throttling_exception.ThrottlingException: <p>The request was throttled because of quota limits.</p>
        capo_rum.errors.validation_exception.ValidationException: <p>One of the arguments for the request is not valid.</p>
        capo_rum.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_rum.types.update_app_monitor_request.UpdateAppMonitorRequest]",
    ) -> OperationResponse[
        "capo_rum.types.update_app_monitor_response.UpdateAppMonitorResponse"
    ]:
        import capo_rum._operations.rum.update_app_monitor

        output, http_response = (
            capo_rum._operations.rum.update_app_monitor.update_app_monitor(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAppMonitor")
    )
    input_: capo_rum.types.update_app_monitor_request.UpdateAppMonitorRequest = {
        "name": name
    }
    if domain is not None:
        input_["domain"] = domain
    if domain_list is not None:
        input_["domain_list"] = domain_list
    if app_monitor_configuration is not None:
        input_["app_monitor_configuration"] = app_monitor_configuration
    if cw_log_enabled is not None:
        input_["cw_log_enabled"] = cw_log_enabled
    if custom_events is not None:
        input_["custom_events"] = custom_events
    if deobfuscation_configuration is not None:
        input_["deobfuscation_configuration"] = deobfuscation_configuration

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output