Skip to content

Commit

Permalink
fixed: tracing working
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgrav committed Apr 8, 2022
1 parent 15a364a commit 37eb608
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ protected function normalize($data, int $depth = 0)
return $data->jsonSerialize();
}

if ($data instanceof EcsTracing) {
return $data->jsonSerialize();
}

return parent::normalize($data, $depth);
}

Expand Down Expand Up @@ -104,7 +108,8 @@ public function format(array $record): string

// Add Tracing Context
if (isset($inRecord['context']['tracing']['Elastic\Types\Tracing']) === true) {
$outRecord += $inRecord['context']['tracing']['Elastic\Types\Tracing'];
$outRecord['trace.id'] = $inRecord['context']['tracing']['Elastic\Types\Tracing']['trace.id'];
$outRecord['span.id'] = $inRecord['context']['tracing']['Elastic\Types\Tracing']['span.id'];
unset($inRecord['context']['tracing']);
}

Expand Down

0 comments on commit 37eb608

Please sign in to comment.