createTraceparent(spanContext) {
    if (spanContext) {
      const traceparent = Traceparent.fromSpanContext(spanContext)
      return traceparent.toString()
    }

    // In case we receive a trace ID that isn't the proper length, zero pad
    let traceId = this.transaction.traceId.toLowerCase()
    traceId = traceId.padStart(32, '0')

    // If no segment/span is in context, generate one so we can have a valid traceparent
    const segment = this.transaction.agent.tracer.getSegment()
    let parentId = segment && segment.id
    if (!parentId) {
      parentId = hashes.makeId(16)
      logger.debug(
        'No segment/span in context. Generated new traceparent parentId (%s) for traceId (%s)',
        parentId,
        traceId
      )
    }

    const traceparent = new Traceparent({ traceId, parentId, flags: this.createFlagsHex() })
    return traceparent.toString()
  }
@param {object} spanContext if passed in, it'll use this to construct traceparent. only used in otel bridge mode.
@returns {string} a W3C TraceContext traceparent header payload.