diff --git a/src/Jaeger/Jaeger.php b/src/Jaeger/Jaeger.php index f67ae90..4d3bbfd 100644 --- a/src/Jaeger/Jaeger.php +++ b/src/Jaeger/Jaeger.php @@ -227,7 +227,7 @@ public function flush(){ private function generateId(){ - return microtime(true) * 10000 . rand(1000, 9999); + return microtime(true) * 10000 . rand(10000, 99999); } } diff --git a/src/Jaeger/SpanContext.php b/src/Jaeger/SpanContext.php index ab11660..588c758 100644 --- a/src/Jaeger/SpanContext.php +++ b/src/Jaeger/SpanContext.php @@ -76,9 +76,9 @@ public function isSampled(){ public function traceIdToString($traceId){ $len = strlen($traceId); - if($len > 15){ - $this->traceIdHigh = hexdec(substr($traceId, 0, 15)); - $this->traceIdLow = hexdec(substr($traceId, 15)); + if($len > 16){ + $this->traceIdHigh = hexdec(substr($traceId, 0, 16)); + $this->traceIdLow = hexdec(substr($traceId, 16)); }else{ $this->traceIdLow = hexdec($traceId); }