code: public void close() throws IOException
    {
      if (isClosed)
      {
        throw new IOException("Telemetry connector is closed");
      }
      try
      {
        this.sendBatch();
      }
      catch (IOException e)
      {
        logger.error("Send logs failed on closing", e);
      }
      finally
      {
        this.isClosed = true;
      }
    }
docs: Close telemetry connector and send any unsubmitted logs
  
  @throws IOException if closed or uploading batch fails