10. CloudWatch Metrics

Spring Cloud AWS provides Spring Boot auto-configuration for Micrometer CloudWatch integration. To send metrics to CloudWatch add a dependency to spring-cloud-aws-actuator module:spring-doc.cn

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-aws-actuator</artifactId>
</dependency>

Additionally CloudWatch integration requires a value provided for management.metrics.export.cloudwatch.namespace configuration property.spring-doc.cn

Following configuration properties are available to configure CloudWatch integration:spring-doc.cn

property default description

management.metrics.export.cloudwatch.namespacespring-doc.cn

The namespace which will be used when sending metrics to CloudWatch. This property is needed and must not be null.spring-doc.cn

management.metrics.export.cloudwatch.enabledspring-doc.cn

truespring-doc.cn

If CloudWatch integration should be enabled. This property should be likely set to false for a local development profile.spring-doc.cn

management.metrics.export.cloudwatch.stepspring-doc.cn

1mspring-doc.cn

The interval at which metrics are sent to CloudWatch. The default is 1 minute.spring-doc.cn