Skip to content

Commit

Permalink
Merge pull request #36 from Liv1020/fix-istio-1.1.3
Browse files Browse the repository at this point in the history
fix istio 1.1.3 jaeger traceID 32-bit overflow
  • Loading branch information
jky-yy authored Apr 25, 2019
2 parents b31a98b + daecd3d commit 8a4a7b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Jaeger/Propagator/ZipkinPropagator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]){
Expand Down
4 changes: 4 additions & 0 deletions src/Jaeger/SpanContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 8a4a7b5

Please sign in to comment.