putRumEvents method
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.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter appMonitorDetails :
A structure that contains information about the app monitor that collected
this telemetry information.
Parameter batchId :
A unique identifier for this batch of RUM event data.
Parameter id :
The ID of the app monitor that is sending this data.
Parameter rumEvents :
An array of structures that contain the telemetry event data.
Parameter userDetails :
A structure that contains information about the user session that this
batch of events was collected from.
Parameter alias :
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.
Implementation
Future<void> putRumEvents({
required AppMonitorDetails appMonitorDetails,
required String batchId,
required String id,
required List<RumEvent> rumEvents,
required UserDetails userDetails,
String? alias,
}) async {
final $payload = <String, dynamic>{
'AppMonitorDetails': appMonitorDetails,
'BatchId': batchId,
'RumEvents': rumEvents,
'UserDetails': userDetails,
if (alias != null) 'Alias': alias,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/appmonitors/${Uri.encodeComponent(id)}/',
exceptionFnMap: _exceptionFns,
);
}