Skip to content

update_rum_metric_definition

update_rum_metric_definition(
    app_monitor_name: AppMonitorName,
    destination: MetricDestination,
    metric_definition: MetricDefinitionRequest,
    metric_definition_id: MetricDefinitionId,
    *,
    config_overrides: Optional[RUMClientConfig] = None,
    destination_arn: Optional[DestinationArn] = None,
) -> UpdateRumMetricDefinitionResponse

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

Parameters:

  • app_monitor_name (AppMonitorName) –

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

  • destination (MetricDestination) –

    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.

  • destination_arn (Optional[DestinationArn], default: None ) –

    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.

  • metric_definition (MetricDefinitionRequest) –

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

  • metric_definition_id (MetricDefinitionId) –

    The ID of the metric definition to update.

Raises:

Source code in docs_src/capo_rum/_services/rum.py
def update_rum_metric_definition(
    self,
    app_monitor_name: "capo_rum.types.app_monitor_name.AppMonitorName",
    destination: "capo_rum.types.metric_destination.MetricDestination",
    metric_definition: "capo_rum.types.metric_definition_request.MetricDefinitionRequest",
    metric_definition_id: "capo_rum.types.metric_definition_id.MetricDefinitionId",
    *,
    config_overrides: Optional[RUMClientConfig] = None,
    destination_arn: Optional[
        "capo_rum.types.destination_arn.DestinationArn"
    ] = None,
) -> "capo_rum.types.update_rum_metric_definition_response.UpdateRumMetricDefinitionResponse":
    """<p>Modifies one existing metric definition for CloudWatch RUM extended metrics. For more information about extended metrics, see <a href="https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_BatchCreateRumMetricsDefinitions.html">BatchCreateRumMetricsDefinitions</a>.</p>

    Args:
        app_monitor_name: <p>The name of the CloudWatch RUM app monitor that sends these metrics.</p>
        destination: <p>The destination to send the metrics to. Valid values are <code>CloudWatch</code> and <code>Evidently</code>. If you specify <code>Evidently</code>, 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.</p>
        destination_arn: <p>This parameter is required if <code>Destination</code> is <code>Evidently</code>. If <code>Destination</code> is <code>CloudWatch</code>, do not use this parameter.</p> <p>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 <a href="https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_PutRumMetricsDestination.html">PutRumMetricsDestination</a>.</p>
        metric_definition: <p>A structure that contains the new definition that you want to use for this metric.</p>
        metric_definition_id: <p>The ID of the metric definition to update.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>This request exceeds a service quota.</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_rum_metric_definition_request.UpdateRumMetricDefinitionRequest]",
    ) -> OperationResponse[
        "capo_rum.types.update_rum_metric_definition_response.UpdateRumMetricDefinitionResponse"
    ]:
        import capo_rum._operations.rum.update_rum_metric_definition

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateRumMetricDefinition")
    )
    input_: capo_rum.types.update_rum_metric_definition_request.UpdateRumMetricDefinitionRequest = {
        "app_monitor_name": app_monitor_name,
        "destination": destination,
        "metric_definition": metric_definition,
        "metric_definition_id": metric_definition_id,
    }
    if destination_arn is not None:
        input_["destination_arn"] = destination_arn

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