code: private void retrieveAndQueryMetrics(String queryServiceAddress) {
  		LOG.debug("Retrieve metric query service gateway for {}", queryServiceAddress);
  
  		final CompletableFuture<MetricQueryServiceGateway> queryServiceGatewayFuture = queryServiceRetriever.retrieveService(queryServiceAddress);
  
  		queryServiceGatewayFuture.whenCompleteAsync(
  			(MetricQueryServiceGateway queryServiceGateway, Throwable t) -> {
  				if (t != null) {
  					LOG.debug("Could not retrieve QueryServiceGateway.", t);
  				} else {
  					queryMetrics(queryServiceGateway);
  				}
  			},
  			executor);
  	}
docs: Retrieves and queries the specified QueryServiceGateway.
  
  @param queryServiceAddress specifying the QueryServiceGateway