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
4646
4747 private function parseConfig (): array
4848 {
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+
4961 return [
5062 $ 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
5864 ];
5965 }
6066
@@ -67,4 +73,13 @@ private function getPrefix(): string
6773 {
6874 return rtrim ($ this ->prefix . $ this ->name , '. ' ) . '. ' ;
6975 }
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+ }
7085}
You can’t perform that action at this time.
0 commit comments