flush
Sends every span that ended and was not sent yet, and returns when the collector answered. Call it before the app ends, or when a page in the browser is hidden. A span that has not ended, of a run that is still going, is sent when it ends. Failures go to onExportFailed.