enableEnhancedMonitoring method
Enables enhanced Kinesis data stream monitoring for shard-level metrics.
May throw AccessDeniedException.
May throw InvalidArgumentException.
May throw LimitExceededException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
Parameter shardLevelMetrics :
List of shard-level metrics to enable.
The following are the valid shard-level metrics. The value
"ALL" enables every metric.
-
IncomingBytes -
IncomingRecords -
OutgoingBytes -
OutgoingRecords -
WriteProvisionedThroughputExceeded -
ReadProvisionedThroughputExceeded -
IteratorAgeMilliseconds -
ALL
Parameter streamARN :
The ARN of the stream.
Parameter streamId :
Not Implemented. Reserved for future use.
Parameter streamName :
The name of the stream for which to enable enhanced monitoring.
Implementation
Future<EnhancedMonitoringOutput> enableEnhancedMonitoring({
required List<MetricsName> shardLevelMetrics,
String? streamARN,
String? streamId,
String? streamName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Kinesis_20131202.EnableEnhancedMonitoring'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ShardLevelMetrics': shardLevelMetrics.map((e) => e.value).toList(),
if (streamARN != null) 'StreamARN': streamARN,
if (streamId != null) 'StreamId': streamId,
if (streamName != null) 'StreamName': streamName,
},
);
return EnhancedMonitoringOutput.fromJson(jsonResponse.body);
}