Use first party metric aggregator libraries where possible.

This commit is contained in:
Jon Chambers 2020-07-24 17:02:01 -04:00 committed by Jon Chambers
parent e25914c3d3
commit 33a0c4a9ae
3 changed files with 6 additions and 19 deletions

View File

@ -81,9 +81,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.micrometer</groupId> <groupId>com.newrelic.telemetry</groupId>
<artifactId>micrometer-registry-new-relic</artifactId> <artifactId>micrometer-registry-new-relic</artifactId>
<version>1.5.2</version> <version>0.5.0</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -43,10 +43,9 @@ import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment; import io.dropwizard.setup.Environment;
import io.lettuce.core.RedisURI; import io.lettuce.core.RedisURI;
import io.lettuce.core.cluster.RedisClusterClient; import io.lettuce.core.cluster.RedisClusterClient;
import io.micrometer.core.instrument.Clock; import io.micrometer.NewRelicRegistryConfig;
import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Metrics;
import io.micrometer.newrelic.NewRelicConfig; import io.micrometer.newrelic.NewRelicRegistry;
import io.micrometer.newrelic.NewRelicMeterRegistry;
import io.micrometer.wavefront.WavefrontConfig; import io.micrometer.wavefront.WavefrontConfig;
import io.micrometer.wavefront.WavefrontMeterRegistry; import io.micrometer.wavefront.WavefrontMeterRegistry;
import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.jce.provider.BouncyCastleProvider;
@ -252,22 +251,17 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
{ {
final MicrometerConfiguration micrometerNewRelicConfig = micrometerConfigurationByName.get("newrelic"); final MicrometerConfiguration micrometerNewRelicConfig = micrometerConfigurationByName.get("newrelic");
Metrics.addRegistry(new NewRelicMeterRegistry(new NewRelicConfig() { Metrics.addRegistry(NewRelicRegistry.builder(new NewRelicRegistryConfig() {
@Override @Override
public String get(final String key) { public String get(final String key) {
return null; return null;
} }
@Override
public String accountId() {
return micrometerNewRelicConfig.getAccountId();
}
@Override @Override
public String apiKey() { public String apiKey() {
return micrometerNewRelicConfig.getApiKey(); return micrometerNewRelicConfig.getApiKey();
} }
}, Clock.SYSTEM)); }).build());
} }
environment.getObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); environment.getObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

View File

@ -18,9 +18,6 @@ public class MicrometerConfiguration {
@NotEmpty @NotEmpty
private String apiKey; private String apiKey;
@JsonProperty
private String accountId;
public String getName() { public String getName() {
return name; return name;
} }
@ -32,8 +29,4 @@ public class MicrometerConfiguration {
public String getApiKey() { public String getApiKey() {
return apiKey; return apiKey;
} }
public String getAccountId() {
return accountId;
}
} }