use of com.netflix.spectator.aws.SpectatorRequestMetricCollector in project titus-control-plane by Netflix.
the class AmazonClientProvider method getLoadBalancingClient.
public AmazonElasticLoadBalancingAsync getLoadBalancingClient(String accountId) {
AmazonElasticLoadBalancingAsync client = loadBalancerClients.get(accountId);
if (client == null) {
synchronized (this) {
client = loadBalancerClients.get(accountId);
if (client == null) {
String region = AwsRegionConfigurationUtil.resolveDataPlaneRegion(configuration);
AWSCredentialsProvider credentialsProvider = getAwsCredentialsProvider(accountId);
client = AmazonElasticLoadBalancingAsyncClientBuilder.standard().withCredentials(credentialsProvider).withRegion(region).withMetricsCollector(new SpectatorRequestMetricCollector(registry)).build();
loadBalancerClients.put(accountId, client);
}
}
}
return client;
}
Aggregations