awslabs / dynamodb-cross-region-library

A library to facilitate cross-region replication with Amazon DynamoDB Streams.
Apache License 2.0
275 stars 98 forks source link

DynamoDBReplicationEmitter does not respect --dontPublishCloudwatch #46

Closed colinking closed 4 years ago

colinking commented 7 years ago

emitCloudWatchMetrics in DynamoDBReplicationEmitter.java calls putMetricDataAsync on the cloudwatch object, which is an instance of NoopCloudWatch when --dontPublishCloudwatch is specified. This leads to unintended behavior, and metric publishing failures.

colinking commented 7 years ago

Actually, upon debugging further, it seems that DynamoDBMasterToReplicasPipeline calls the deprecated DynamoDBReplicationEmitter constructor which takes only the streams configuration. Therefore, it isn't actually using the NoopCloudWatch instance, but instead creates a new Cloudwatch client.