function getActiveSegment(obj) {
  const segment = this.getSegment(obj)
  const transaction = this.tracer.getTransaction()
  if (transaction?.isActive()) {
    return segment
  }
  return null
}
Retrieves the segment associated with the given object, or the currently
active segment if no object is given.

- `getActiveSegment([obj])`

An active segment is one whose transaction is still active (e.g. has not
ended yet).

@memberof Shim.prototype
@param {*} [obj] - The object to retrieve a segment from.
@returns {?TraceSegment} The trace segment associated with the given object or
 the currently active segment if no object is provided or no segment is
 associated with the object.