Skip to content

Commit

Permalink
fix: 删除不需要的上下文存储
Browse files Browse the repository at this point in the history
  • Loading branch information
titrxw committed Jun 10, 2021
1 parent d7da8bf commit 09fd6b8
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/TracerSpanTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ protected function makeSpan($traceName, $spanName, $kind) {
$header = rtrim(implode(';', $header), ';');
}
}
$headerContextKey = 'opentracing:tracer:headers';
$contextHeaders = array_merge($contextHeaders, $this->getContext()->getContextDataByKey($headerContextKey, []));
$spanContext = $tracer->extract(TEXT_MAP, $contextHeaders);
$scope = $tracer->startActiveSpan($spanName, ['child_of' => $spanContext]);
$traceSpan = $scope->getSpan();
Expand All @@ -93,7 +91,6 @@ protected function makeSpan($traceName, $spanName, $kind) {
$traceSpan->setTag(SPAN_KIND, $kind);
$traceSpan->addBaggageItem('x-span-kind', $kind);
if ($request) {
$this->getContext()->setContextDataByKey($headerContextKey, $traceHeaders);
foreach ($traceHeaders as $name => $header) {
$request = $request->withHeader($name, $header);
}
Expand Down

0 comments on commit 09fd6b8

Please sign in to comment.