Reputation: 817
I'm trying to follow the instructions here.
I've added -Dcom.amazonaws.sdk.enableDefaultMetrics=cloudwatchRegion=eu-west-2
to the java options. I also added the following dependencies in the maven pom:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudwatch</artifactId>
<version>1.11.557</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-dynamodb</artifactId>
<version>1.11.557</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
<version>1.11.557</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudwatchmetrics</artifactId>
<version>1.11.557</version>
<scope>provided</scope>
</dependency>
The docker container runs fine on an ec2 instance with the correct iam role and policies. However, there are no CloudWatch namespaces for AWS SDK/Java as the documentation suggests.
Upvotes: 1
Views: 1511
Reputation: 11
This uses another dependency, change the aws-java-sdk-cloudwatch to aws-java-sdk-cloudwatchmetrics.
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudwatchmetrics</artifactId>
<version>1.11.557</version>
<scope>provided</scope>
</dependency>
Upvotes: 1