Skip to content

Commit

Permalink
Revert "ensuring that options tags will not send array that will brea…
Browse files Browse the repository at this point in the history
…k the span" (#15)

Revert "ensuring that options tags will not send array that will break the sp…"

This reverts commit 71c3ddd.
  • Loading branch information
luizmanhani committed Jun 13, 2024
1 parent 71c3ddd commit 8e34536
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions src/Adapter/JaegerTracerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,15 @@ public function make(string $name): Tracer

private function parseConfig(): array
{
$options = $this->getConfig('options', [
'sampler' => [
'type' => SAMPLER_TYPE_CONST,
'param' => true,
],
'logging' => false
]);

if (isset($options['tags'])) {
$options['tags'] = $this->sanitizeTags($options['tags']);
}

return [
$this->getConfig('name', 'skeleton'),
$options
$this->getConfig('options', [
'sampler' => [
'type' => SAMPLER_TYPE_CONST,
'param' => true,
],
'logging' => false,
]),
];
}

Expand All @@ -73,13 +67,4 @@ private function getPrefix(): string
{
return rtrim($this->prefix . $this->name, '.') . '.';
}

private function sanitizeTags(array $tags = []): array
{
$tagsSanitized = [];
foreach ($tags as $key => $value) {
$tagsSanitized[$key] = (is_array($value)) ? $value[0] : $value;
}
return $tagsSanitized;
}
}

0 comments on commit 8e34536

Please sign in to comment.