constructor(maxlen = 1000) {
    this._maxlen = maxlen;
    this.spans = [];
  }
This is just so that we don't run out of memory while recording a lot
of spans. At some point we just stop and flush out the start of the
trace tree (i.e.the first n spans with the smallest
start_timestamp).