I have a use case wherein I want to publish my spring boot API metrics to Datadog & CloudWatch simultaneously.
I have added the below dependencies to my pom.
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-statsd</artifactId>
<version>${micrometer.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-cloudwatch</artifactId>
<version>${micrometer.version}</version>
</dependency>
Main Application class
@SpringBootApplication
public class MyApplication {
@Bean
MeterRegistryCustomizer<MeterRegistry> metricsCommonTags() {
return registry -> registry.config().commonTags("my-tag", "my-common-tag");
}
}
I have added all required properties in the application. properties as well.
I can see metrics are being published to both Datadog & CloudWatch with default metrics name http.server.request
But I want the metrics name for Datadog to be different & for this, I have added the below property.
management.metrics.web.server.requests-metric-name = i.want.to.be.different
But this is changing the name for both CloudWatch & Datadog.
My question is, how can I change the default metrics name for Datadog only or keep words different for both.