acceptTraceContextPayload(traceparentHeader, tracestateHeader) {
    const result = { traceparent: undefined, tracestate: undefined }
    if (!traceparentHeader) {
      // From the W3C spec: If the vendor failed to parse traceparent, it MUST NOT
      // attempt to parse tracestate.
      // See https://www.w3.org/TR/trace-context/#no-traceparent-received.
      return result
    }

    let traceparent
    try {
      traceparent = Traceparent.fromHeader(traceparentHeader)
    } catch (error) {
      logger.trace('Invalid traceparent for transaction %s: %s', this.transaction.id, traceparentHeader)
      logger.error('Traceparent parse error: %s', error.message)
      this.transaction.agent.recordSupportability('TraceContext/TraceParent/Parse/Exception')
      return result
    }
    result.traceparent = traceparent
    logger.trace('Accepted traceparent for transaction %s', this.transaction.id)

    let tracestate
    try {
      tracestate = Tracestate.fromHeader({ header: tracestateHeader, agent: this.transaction.agent })
    } catch (error) {
      logger.trace('Invalid tracestate for transaction %s: %s', this.transaction.id, tracestateHeader)
      logger.error('Tracestate parse error: %s', error.message)
      this.transaction.agent.recordSupportability('TraceContext/TraceState/Parse/Exception')
      return result
    }
    result.tracestate = tracestate

    // Keep the raw, non-NewRelic tracestate string stored so that we can propagate it
    this._traceStateRaw = tracestate.toString()
    // These need to be kept to be added to root span events as an attribute
    this.tracingVendors = tracestate.vendors

    if (tracestate.intrinsics && tracestate.intrinsics.version !== TracestateIntrinsics.NR_TRACESTATE_VERSION) {
      logger.trace(
        'Incoming tracestate version: %s, agent tracestate version: %s',
        tracestate.intrinsics.version,
        TracestateIntrinsics.NR_TRACESTATE_VERSION
      )
    }

    if (tracestate.intrinsics?.isValid === false) {
      logger.error('Invalid tracestate for transaction %s: %s', this.transaction.id, tracestateHeader)
      this.transaction.agent.recordSupportability('TraceContext/TraceState/InvalidNrEntry')
      return result
    }

    // We have to set the trustedParentId _after_ verifying the intrinsics are
    // valid because the cross agent distributed tests do not expect this
    // property to be set if the intrinsics are invalid.
    this.trustedParentId = tracestate.spanId

    logger.trace('Accepted tracestate for transaction %s', this.transaction.id)
    this.transaction.agent.recordSupportability('TraceContext/Accept/Success')

    return result
  }
Takes a TraceContext headers from an HTTP request, parses them, validates them, and
applies the values to the internal state, returning an object with the
relevant Trace Context data and validation information.

@param {string} traceparentHeader - W3C traceparent header from an HTTP request
@param {string} tracestateHeader - W3C tracestate header from an HTTP request
@returns {object} returns an Object with the traceparent data and validation info