def METHOD_NAME(self):
    # type: () -> str
    tp = self._meta.get(W3C_TRACEPARENT_KEY)
    if self.span_id is None or self.trace_id is None:
        # if we only have a traceparent then we'll forward it
        # if we don't have a span id or trace id value we can't build a valid traceparent
        return tp or ""
    # determine the trace_id value
    if tp:
        # grab the original traceparent trace id, not the converted value
        trace_id = tp.split("-")[1]
    else:
        trace_id = "{:032x}".format(self.trace_id)
    sampled = 1 if self.sampling_priority and self.sampling_priority > 0 else 0
    return "00-{}-{:016x}-{:02x}".format(trace_id, self.span_id, sampled)