diff --git a/src/Jaeger/Propagator/ZipkinPropagator.php b/src/Jaeger/Propagator/ZipkinPropagator.php index 1c60632..39125c4 100644 --- a/src/Jaeger/Propagator/ZipkinPropagator.php +++ b/src/Jaeger/Propagator/ZipkinPropagator.php @@ -17,7 +17,7 @@ public function inject(SpanContext $spanContext, $format, &$carrier){ public function extract($format, $carrier){ $spanContext = new SpanContext(0, 0, 0, null, 0); if(isset($carrier[Constants\X_B3_TRACEID]) && $carrier[Constants\X_B3_TRACEID]){ - $spanContext->traceIdLow = $spanContext->hexToSignedInt($carrier[Constants\X_B3_TRACEID]); + $spanContext->traceIdToString($carrier[Constants\X_B3_TRACEID]); } if(isset($carrier[Constants\X_B3_PARENT_SPANID]) && $carrier[Constants\X_B3_PARENT_SPANID]){ diff --git a/src/Jaeger/SpanContext.php b/src/Jaeger/SpanContext.php index 38e1884..45c6cdf 100644 --- a/src/Jaeger/SpanContext.php +++ b/src/Jaeger/SpanContext.php @@ -76,6 +76,10 @@ public function parentIdToString(){ public function traceIdLowToString(){ + if ($this->traceIdHigh) { + return sprintf("%x%016x", $this->traceIdHigh, $this->traceIdLow); + } + return sprintf("%x", $this->traceIdLow); }