code: public PullProcessorPipeline build() throws Exception {
          ApiServer api = null;
          PullMetricRegistryInstance registry = null;
          try {
              final EndpointRegistration epr;
              if (epr_ == null)
                  epr = api = new ApiServer(api_sockaddr_);
              else
                  epr = epr_;
  
              registry = cfg_.create(PullMetricRegistryInstance::new, epr);
  
              if (api != null) api.start();
              return new PullProcessorPipeline(registry);
          } catch (Exception ex) {
              // Close API server.
              try {
                  if (api != null) api.close();
              } catch (Exception ex1) {
                  ex.addSuppressed(ex1);
              }
  
              // Close registry.
              try {
                  if (registry != null) registry.close();
              } catch (Exception ex1) {
                  ex.addSuppressed(ex1);
              }
  
              throw ex;
          }
      }
docs: /*
  Creates a pull processor.
  
  The API server is started by this method.
  The returned pull processor is thread-safe.
  
  Note that the history will not be used.
  @return A PullMetricRegistryInstance that performs a scrape and evaluates rules.
  @throws Exception indicating construction failed.