function spanIsSampled(span) {
  // We align our trace flags with the ones OpenTelemetry use
  // So we also check for sampled the same way they do.
  const { traceFlags } = span.spanContext();
  // eslint-disable-next-line no-bitwise
  return Boolean(traceFlags & TRACE_FLAG_SAMPLED);
}
Returns true if a span is sampled.
In most cases, you should just use `span.isRecording()` instead.
However, this has a slightly different semantic, as it also returns false if the span is finished.
So in the case where this distinction is important, use this method.