- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
EnableEnhancedMonitoringCommand
Enables enhanced Kinesis data stream monitoring for shard-level metrics.
When invoking this API, you must use either the StreamARN
or the StreamName
parameter, or both. It is recommended that you use the StreamARN
input parameter when you invoke this API.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { KinesisClient, EnableEnhancedMonitoringCommand } from "@aws-sdk/client-kinesis"; // ES Modules import
// const { KinesisClient, EnableEnhancedMonitoringCommand } = require("@aws-sdk/client-kinesis"); // CommonJS import
const client = new KinesisClient(config);
const input = { // EnableEnhancedMonitoringInput
StreamName: "STRING_VALUE",
ShardLevelMetrics: [ // MetricsNameList // required
"IncomingBytes" || "IncomingRecords" || "OutgoingBytes" || "OutgoingRecords" || "WriteProvisionedThroughputExceeded" || "ReadProvisionedThroughputExceeded" || "IteratorAgeMilliseconds" || "ALL",
],
StreamARN: "STRING_VALUE",
};
const command = new EnableEnhancedMonitoringCommand(input);
const response = await client.send(command);
// { // EnhancedMonitoringOutput
// StreamName: "STRING_VALUE",
// CurrentShardLevelMetrics: [ // MetricsNameList
// "IncomingBytes" || "IncomingRecords" || "OutgoingBytes" || "OutgoingRecords" || "WriteProvisionedThroughputExceeded" || "ReadProvisionedThroughputExceeded" || "IteratorAgeMilliseconds" || "ALL",
// ],
// DesiredShardLevelMetrics: [
// "IncomingBytes" || "IncomingRecords" || "OutgoingBytes" || "OutgoingRecords" || "WriteProvisionedThroughputExceeded" || "ReadProvisionedThroughputExceeded" || "IteratorAgeMilliseconds" || "ALL",
// ],
// StreamARN: "STRING_VALUE",
// };
EnableEnhancedMonitoringCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ShardLevelMetrics Required | MetricsName[] | undefined | List of shard-level metrics to enable. The following are the valid shard-level metrics. The value "
For more information, see Monitoring the Amazon Kinesis Data Streams Service with Amazon CloudWatch in the Amazon Kinesis Data Streams Developer Guide. |
StreamARN | string | undefined | The ARN of the stream. |
StreamName | string | undefined | The name of the stream for which to enable enhanced monitoring. |
EnableEnhancedMonitoringCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
CurrentShardLevelMetrics | MetricsName[] | undefined | Represents the current state of the metrics that are in the enhanced state before the operation. |
DesiredShardLevelMetrics | MetricsName[] | undefined | Represents the list of all the metrics that would be in the enhanced state after the operation. |
StreamARN | string | undefined | The ARN of the stream. |
StreamName | string | undefined | The name of the Kinesis data stream. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | Specifies that you do not have the permissions required to perform this operation. |
InvalidArgumentException | client | A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message. |
LimitExceededException | client | The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed. |
ResourceInUseException | client | The resource is not available for this operation. For successful operation, the resource must be in the |
ResourceNotFoundException | client | The requested resource could not be found. The stream might not be specified correctly. |
KinesisServiceException | Base exception class for all service exceptions from Kinesis service. |