File tree 2 files changed +35
-0
lines changed
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 12
12
13
13
use BackedEnum ;
14
14
use Lunr \Corona \Parsers \TracingInfo \TracingInfoValue ;
15
+ use Lunr \Ticks \EventLogging \EventInterface ;
15
16
use Lunr \Ticks \TracingControllerInterface ;
16
17
use Lunr \Ticks \TracingInfoInterface ;
17
18
use RuntimeException ;
21
22
* Manages access to $_POST, $_GET values, as well as
22
23
* the request URL parameters
23
24
*
25
+ * @phpstan-import-type Tags from EventInterface
26
+ *
24
27
* @property-read string $action The HTTP method used for the request
25
28
* @property-read string $protocol The protocol used for the request
26
29
* @property-read string $domain The domain used for the request
@@ -203,6 +206,20 @@ public function getParentSpanId(): ?string
203
206
return $ this ->get (TracingInfoValue::ParentSpanID);
204
207
}
205
208
209
+ /**
210
+ * Get tags that are specific to the current span.
211
+ *
212
+ * @return Tags Indexed metadata about the current span
213
+ */
214
+ public function getSpanSpecificTags (): array
215
+ {
216
+ return [
217
+ 'controller ' => $ this ->controller ,
218
+ 'method ' => $ this ->method ,
219
+ 'call ' => $ this ->call ,
220
+ ];
221
+ }
222
+
206
223
/**
207
224
* Get a request value.
208
225
*
Original file line number Diff line number Diff line change @@ -321,6 +321,24 @@ public function testGetParentSpanIdWithUncachedValue(): void
321
321
$ this ->assertEquals ($ id , $ value );
322
322
}
323
323
324
+ /**
325
+ * Test getSpanSpecificTags().
326
+ *
327
+ * @covers Lunr\Corona\Request::getSpanSpecificTags
328
+ */
329
+ public function testGetSpanSpecificTags ()
330
+ {
331
+ $ expected = [
332
+ 'controller ' => 'controller ' ,
333
+ 'method ' => 'method ' ,
334
+ 'call ' => 'controller/method ' ,
335
+ ];
336
+
337
+ $ value = $ this ->class ->getSpanSpecificTags ();
338
+
339
+ $ this ->assertEquals ($ expected , $ value );
340
+ }
341
+
324
342
}
325
343
326
344
?>
You can’t perform that action at this time.
0 commit comments