Micrometer CloudWatch

Table of Contents

Amazon CloudWatch is a dimensional time-series SaaS on Amazon’s cloud.

1. Installing

For Gradle, add the following implementation:

implementation 'io.micrometer:micrometer-registry-cloudwatch2:latest.release'

For Maven, add the following dependency:

The micrometer-registry-cloudwatch2 module uses AWS SDK v2. micrometer-registry-cloudwatch is for AWS SDK v1.

2. Configuring

The following example configures Micrometer CloudWatch:

CloudWatchConfig cloudWatchConfig = new CloudWatchConfig() {
    public String get(String s) {
        return null;

    public String namespace() {
        return "mynamespace";
MeterRegistry meterRegistry = new CloudWatchMeterRegistry(cloudWatchConfig, Clock.SYSTEM, CloudWatchAsyncClient.create());

You can provide your own CloudWatchAsyncClient to the constructor of the registry.

CloudWatchConfig is an interface with a set of default methods. If, in the implementation of get(String k), rather than returning null, you instead bind it to a property source, you can override the default configuration. For example, Micrometer support in Spring Cloud AWS binds properties prefixed with management.metrics.export.cloudwatch directly to the CloudWatchConfig:

    namespace: YOURNAMESPACE

    # You will probably want to disable publishing in a local development profile.
    enabled: true

    # The interval at which metrics are sent to CloudWatch. The default is 1 minute.
    step: 1m