Skip to content

put_rum_events async

put_rum_events(
    id: AppMonitorId,
    batch_id: str,
    app_monitor_details: AppMonitorDetails,
    user_details: UserDetails,
    rum_events: RumEventList,
    *,
    config_overrides: Optional[AsyncRUMClientConfig] = None,
    alias: Optional[Alias] = None,
) -> PutRumEventsResponse

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.

Parameters:

  • id (AppMonitorId) –

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

  • batch_id (str) –

    A unique identifier for this batch of RUM event data.

  • app_monitor_details (AppMonitorDetails) –

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

  • user_details (UserDetails) –

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

  • rum_events (RumEventList) –

    An array of structures that contain the telemetry event data.

  • alias (Optional[Alias], default: None ) –

    If the app monitor uses a resource-based policy that requires PutRumEvents requests to specify a certain alias, specify that alias here. This alias will be compared to the rum:alias context key in the resource-based policy. For more information, see Using resource-based policies with CloudWatch RUM.

Raises:

Source code in docs_src/capo_rum/_services/async_rum.py
async def put_rum_events(
    self,
    id: "capo_rum.types.app_monitor_id.AppMonitorId",
    batch_id: str,
    app_monitor_details: "capo_rum.types.app_monitor_details.AppMonitorDetails",
    user_details: "capo_rum.types.user_details.UserDetails",
    rum_events: "capo_rum.types.rum_event_list.RumEventList",
    *,
    config_overrides: Optional[AsyncRUMClientConfig] = None,
    alias: Optional["capo_rum.types.alias.Alias"] = None,
) -> "capo_rum.types.put_rum_events_response.PutRumEventsResponse":
    """<p>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 <code>PutRumEvents</code> operations to send this data to RUM.</p> <p>Each <code>PutRumEvents</code> operation can send a batch of events from one user session.</p>

    Args:
        id: <p>The ID of the app monitor that is sending this data.</p>
        batch_id: <p>A unique identifier for this batch of RUM event data.</p>
        app_monitor_details: <p>A structure that contains information about the app monitor that collected this telemetry information.</p>
        user_details: <p>A structure that contains information about the user session that this batch of events was collected from.</p>
        rum_events: <p>An array of structures that contain the telemetry event data.</p>
        alias: <p>If the app monitor uses a resource-based policy that requires <code>PutRumEvents</code> requests to specify a certain alias, specify that alias here. This alias will be compared to the <code>rum:alias</code> context key in the resource-based policy. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-resource-policies.html">Using resource-based policies with CloudWatch RUM</a>.</p>

    Raises:
        capo_rum.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rum.types.put_rum_events_request.PutRumEventsRequest]",
    ) -> AsyncOperationResponse[
        "capo_rum.types.put_rum_events_response.PutRumEventsResponse"
    ]:
        import capo_rum._operations.rum.put_rum_events

        (
            output,
            http_response,
        ) = await capo_rum._operations.rum.put_rum_events.async_put_rum_events(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutRumEvents")
    )
    input_: capo_rum.types.put_rum_events_request.PutRumEventsRequest = {
        "id": id,
        "batch_id": batch_id,
        "app_monitor_details": app_monitor_details,
        "user_details": user_details,
        "rum_events": rum_events,
    }
    if alias is not None:
        input_["alias"] = alias

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output