Skip to content

Commit bb56d15

Browse files
committed
Merge branch '2.0.x' into 1.0.x
2 parents 8a10a29 + e4cc860 commit bb56d15

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/Bridge/RequestSpanListener.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function onTerminate(PostResponseEvent $event)
5454
return $this;
5555
}
5656

57+
$this->tracer->finish($this->spans->pop());
5758
$this->tracer->finish(
5859
$this->spans->pop()->addTag(new HttpCodeTag($event->getResponse()->getStatusCode()))
5960
);
@@ -76,16 +77,18 @@ public function onResponse(FilterResponseEvent $event)
7677
}
7778

7879
$request = $event->getRequest();
79-
$this->tracer->start(
80-
$this->nameGenerator->generate() . ':background',
81-
[
82-
new HttpMethodTag($request->getMethod()),
83-
new HttpUriTag($request->getRequestUri()),
84-
new SpanKindServerTag(),
85-
new SymfonyComponentTag(),
86-
new SymfonyVersionTag(),
87-
new SymfonyBackgroundTag(),
88-
]
80+
$this->spans->push(
81+
$this->tracer->start(
82+
'background',
83+
[
84+
new HttpMethodTag($request->getMethod()),
85+
new HttpUriTag($request->getRequestUri()),
86+
new SpanKindServerTag(),
87+
new SymfonyComponentTag(),
88+
new SymfonyVersionTag(),
89+
new SymfonyBackgroundTag(),
90+
]
91+
)
8992
);
9093

9194
return $this;

0 commit comments

Comments
 (0)