Skip to content

Commit

Permalink
LogTracer fix elapsed time log (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Apr 13, 2023
1 parent ba3ca4d commit 4429e7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LogTracer.php
Expand Up @@ -35,7 +35,7 @@ public function trace(
?TraceKind $traceKind = null,
?int $startTime = null
): mixed {
$span = new Span($name);
$span = new Span($name, $attributes);

$this->context['telemetry'] = $this->uuidFactory->uuid4()->toString();

Expand All @@ -45,7 +45,7 @@ public function trace(

$elapsed = $this->clock->now() - $startTime;

$this->logger->debug(\sprintf('Trace [%s] - [%01.4f ms.]', $name, $elapsed / 1_000_000_000), [
$this->logger->debug(\sprintf('Trace [%s] - [%01.4f ms.]', $name, $elapsed / 1_000_000), [
'attributes' => $span->getAttributes(),
'status' => $span->getStatus(),
'scoped' => $scoped,
Expand Down

0 comments on commit 4429e7c

Please sign in to comment.