-
-
Notifications
You must be signed in to change notification settings - Fork 329
Add cloudwatch metrics auto-configuration with aws sdk v2 #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4872e60
to
b7e9b88
Compare
...est/src/test/java/io/awspring/cloud/test/v3/cloudwatch/CloudwatchMetricsIntegrationTest.java
Outdated
Show resolved
Hide resolved
.../main/java/io/awspring/cloud/v3/autoconfigure/metrics/CloudWatchExportAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...est/src/test/java/io/awspring/cloud/test/v3/cloudwatch/CloudwatchMetricsIntegrationTest.java
Outdated
Show resolved
Hide resolved
...est/src/test/java/io/awspring/cloud/test/v3/cloudwatch/CloudwatchMetricsIntegrationTest.java
Outdated
Show resolved
Hide resolved
61a0f3f
to
522daea
Compare
As part of the effort to move to aws-sdk-v2. Metrics has been added using `micrometer-registry-cloudwatch2` as a auto-configuration.
522daea
to
81a3982
Compare
* @since 2.0.0 | ||
*/ | ||
@ConfigurationProperties(prefix = "management.metrics.export.cloudwatch") | ||
public class CloudWatchProperties extends StepRegistryProperties { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the sake of consistency, shouldn't it bind to spring.cloud.aws.cloudwatch
and extends AwsClientProperties
? Similar to how Stackdriver is done in GCP, where StackdriverPropertiesConfigAdapter
adapts GCP properties to Micrometer.
...src/main/java/io/awspring/cloud/autoconfigure/metrics/CloudWatchExportAutoConfiguration.java
Outdated
Show resolved
Hide resolved
I am not sure if this is how its done in Stackdriver integration in GCP. As far as I can see, in Spring Cloud GCP client can be configured with Shouldn't we have the same for Spring Cloud AWS? The benefit of configuring client through |
Spring boot provides auto-configuration for stackdriver and other but not for cloudwatch v1 nor v2 and This PR follows the the current implementation in previous version but I was also thinking about give the shape similar to what GCP does but then I realized that we will be providing two auto-configurations in the same place, one similar to the one that provides spring boot for stackdriver and other similar to the one that spring-cloud-gcp does. I would prefer to keep it as previous version on spring-cloud aws because everything is already powered by spring boot. Let me know your thought on this. |
Do you know why Spring Cloud GCP provides its own Stackdriver autoconfiguration if its already covered in Spring Boot? I think it would be nice that |
spring boot stackdriver auto-configuration needs a project id and credentials to be setup manually meanwhile spring cloud gcp does that automatically taking into account global properties for the attributes mentioned at the beginning. CloudWatchPropeties doesn't extend AwsProperties because it already extends StepRegistryProperties but region and endpoint are already provided in order to keep consistency with other autoconfigurations. |
Kudos, SonarCloud Quality Gate passed! |
Look at the commit I've added as i think its easier to discuss the actual code - when client properties are separated from metrics properties, we can use |
SonarCloud Quality Gate failed.
|
Thanks @eddumelendez. Docs are pending but to avoid efforts for keeping this branch up to date we can add docs in separate PR, just has to be done before we release M2. |
As part of the effort to move to aws-sdk-v2. Metrics has been added using
micrometer-registry-cloudwatch2
as a auto-configuration.