Skip to content

put_rum_metrics_destination

put_rum_metrics_destination(
    app_monitor_name: AppMonitorName,
    destination: MetricDestination,
    *,
    config_overrides: Optional[RUMClientConfig] = None,
    destination_arn: Optional[DestinationArn] = None,
    iam_role_arn: Optional[IamRoleArn] = None,
) -> PutRumMetricsDestinationResponse

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.

Parameters:

  • app_monitor_name (AppMonitorName) –

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

  • destination (MetricDestination) –

    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.

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

    Use this parameter only if Destination is Evidently. This parameter specifies the ARN of the Evidently experiment that will receive the extended metrics.

  • iam_role_arn (Optional[IamRoleArn], default: None ) –

    This parameter is required if Destination is Evidently. If Destination is CloudWatch, don't 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.

    If you specify this parameter, you must be signed on to a role that has PassRole permissions attached to it, to allow the role to be passed. The CloudWatchAmazonCloudWatchRUMFullAccess policy doesn't include PassRole permissions.

Raises:

Source code in docs_src/capo_rum/_services/rum.py
def put_rum_metrics_destination(
    self,
    app_monitor_name: "capo_rum.types.app_monitor_name.AppMonitorName",
    destination: "capo_rum.types.metric_destination.MetricDestination",
    *,
    config_overrides: Optional[RUMClientConfig] = None,
    destination_arn: Optional[
        "capo_rum.types.destination_arn.DestinationArn"
    ] = None,
    iam_role_arn: Optional["capo_rum.types.iam_role_arn.IamRoleArn"] = None,
) -> "capo_rum.types.put_rum_metrics_destination_response.PutRumMetricsDestinationResponse":
    """<p>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.</p> <p>For more information about extended metrics, see <a href="https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_BatchCreateRumMetricDefinitions.html">BatchCreateRumMetricDefinitions</a>.</p>

    Args:
        app_monitor_name: <p>The name of the CloudWatch RUM app monitor that will send the metrics.</p>
        destination: <p>Defines 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 is to be the destination and an IAM role that has permission to write to the experiment.</p>
        destination_arn: <p>Use this parameter only if <code>Destination</code> is <code>Evidently</code>. This parameter specifies the ARN of the Evidently experiment that will receive the extended metrics.</p>
        iam_role_arn: <p>This parameter is required if <code>Destination</code> is <code>Evidently</code>. If <code>Destination</code> is <code>CloudWatch</code>, don't use this parameter.</p> <p>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.</p> <p>If you specify this parameter, you must be signed on to a role that has <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html">PassRole</a> permissions attached to it, to allow the role to be passed. The <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/auth-and-access-control-cw.html#managed-policies-cloudwatch-RUM"> CloudWatchAmazonCloudWatchRUMFullAccess</a> policy doesn't include <code>PassRole</code> permissions.</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.put_rum_metrics_destination_request.PutRumMetricsDestinationRequest]",
    ) -> OperationResponse[
        "capo_rum.types.put_rum_metrics_destination_response.PutRumMetricsDestinationResponse"
    ]:
        import capo_rum._operations.rum.put_rum_metrics_destination

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutRumMetricsDestination")
    )
    input_: capo_rum.types.put_rum_metrics_destination_request.PutRumMetricsDestinationRequest = {
        "app_monitor_name": app_monitor_name,
        "destination": destination,
    }
    if destination_arn is not None:
        input_["destination_arn"] = destination_arn
    if iam_role_arn is not None:
        input_["iam_role_arn"] = iam_role_arn

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