File tree Expand file tree Collapse file tree 1 file changed +22
-7
lines changed Expand file tree Collapse file tree 1 file changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -46,15 +46,21 @@ public function make(string $name): Tracer
46
46
47
47
private function parseConfig (): array
48
48
{
49
+ $ options = $ this ->getConfig ('options ' , [
50
+ 'sampler ' => [
51
+ 'type ' => SAMPLER_TYPE_CONST ,
52
+ 'param ' => true ,
53
+ ],
54
+ 'logging ' => false
55
+ ]);
56
+
57
+ if (isset ($ options ['tags ' ])) {
58
+ $ options ['tags ' ] = $ this ->sanitizeTags ($ options ['tags ' ]);
59
+ }
60
+
49
61
return [
50
62
$ this ->getConfig ('name ' , 'skeleton ' ),
51
- $ this ->getConfig ('options ' , [
52
- 'sampler ' => [
53
- 'type ' => SAMPLER_TYPE_CONST ,
54
- 'param ' => true ,
55
- ],
56
- 'logging ' => false ,
57
- ]),
63
+ $ options
58
64
];
59
65
}
60
66
@@ -67,4 +73,13 @@ private function getPrefix(): string
67
73
{
68
74
return rtrim ($ this ->prefix . $ this ->name , '. ' ) . '. ' ;
69
75
}
76
+
77
+ private function sanitizeTags (array $ tags = []): array
78
+ {
79
+ $ tagsSanitized = [];
80
+ foreach ($ tags as $ key => $ value ) {
81
+ $ tagsSanitized [$ key ] = (is_array ($ value )) ? $ value [0 ] : $ value ;
82
+ }
83
+ return $ tagsSanitized ;
84
+ }
70
85
}
You can’t perform that action at this time.
0 commit comments