@@ -138,11 +138,7 @@ public function onExit()
138138
139139 $ this ->scope ->close ();
140140
141- // Fetch the SpanData of all the collected Spans
142- $ spans = array_map (function (Span $ span ) {
143- return $ span ->spanData ();
144- }, $ this ->tracer ->spans ());
145- $ this ->exporter ->export ($ spans );
141+ $ this ->exporter ->export ($ this ->tracer ->spans ());
146142 }
147143
148144 /**
@@ -210,6 +206,59 @@ public function addAttribute($attribute, $value, $options = [])
210206 $ this ->tracer ->addAttribute ($ attribute , $ value , $ options );
211207 }
212208
209+ /**
210+ * Add an annotation to the provided Span
211+ *
212+ * @param string $description
213+ * @param array $options [optional] Configuration options.
214+ *
215+ * @type Span $span The span to add the annotation to.
216+ * @type array $attributes Attributes for this annotation.
217+ * @type \DateTimeInterface|int|float $time The time of this event.
218+ */
219+ public function addAnnotation ($ description , $ options = [])
220+ {
221+ $ this ->tracer ->addAnnotation ($ description , $ options );
222+ }
223+
224+ /**
225+ * Add a link to the provided Span
226+ *
227+ * @param string $traceId
228+ * @param string $spanId
229+ * @param array $options [optional] Configuration options.
230+ *
231+ * @type Span $span The span to add the link to.
232+ * @type string $type The relationship of the current span relative to
233+ * the linked span: child, parent, or unspecified.
234+ * @type array $attributes Attributes for this annotation.
235+ * @type \DateTimeInterface|int|float $time The time of this event.
236+ */
237+ public function addLink ($ traceId , $ spanId , $ options = [])
238+ {
239+ $ this ->tracer ->addLink ($ traceId , $ spanId , $ options );
240+ }
241+
242+ /**
243+ * Add an message event to the provided Span
244+ *
245+ * @param string $type
246+ * @param string $id
247+ * @param array $options [optional] Configuration options.
248+ *
249+ * @type Span $span The span to add the message event to.
250+ * @type int $uncompressedSize The number of uncompressed bytes sent or
251+ * received.
252+ * @type int $compressedSize The number of compressed bytes sent or
253+ * received. If missing assumed to be the same size as
254+ * uncompressed.
255+ * @type \DateTimeInterface|int|float $time The time of this event.
256+ */
257+ public function addMessageEvent ($ type , $ id , $ options )
258+ {
259+ $ this ->tracer ->addMessageEvent ($ type , $ id , $ options );
260+ }
261+
213262 public function addCommonRequestAttributes (array $ headers )
214263 {
215264 $ responseCode = http_response_code ();
0 commit comments