function decideSamplingFromW3cData({ transaction, traceparent, tracestate }) {
  const {
    remote_parent_sampled: parentSampled,
    remote_parent_not_sampled: parentNotSampled
  } = transaction.agent.config.distributed_tracing.sampler
  if (traceparent.isSampled === true) {
    switch (parentSampled) {
      case 'default': {
        applyOriginalSamplingDecision({ transaction, tracestate })
        break
      }

      case 'always_on': {
        transaction.sampled = true
        transaction.priority = 2.0
        break
      }

      case 'always_off': {
        transaction.sampled = false
        transaction.priority = 0
        break
      }
    }
  } else if (traceparent.isSampled === false) {
    switch (parentNotSampled) {
      case 'default': {
        applyOriginalSamplingDecision({ transaction, tracestate })
        break
      }

      case 'always_on': {
        transaction.sampled = true
        transaction.priority = 2.0
        break
      }

      case 'always_off': {
        transaction.sampled = false
        transaction.priority = 0
        break
      }
    }
  }
}
Updates the transaction with sampling configuration as determined by the
agent's distributed tracing sampler configuration. In short, updates the
transaction to always sample, never sample, or let the standard sampling
algorithm make the decision.

@param {object} params Input parameters.
@param {Transaction} params.transaction The transaction to update.
@param {Traceparent} params.traceparent The object representation of a
traceparent header.
@param {Tracestate} params.tracestate The object representation of a
tracestate header.