phpkin icon indicating copy to clipboard operation
phpkin copied to clipboard

AnnotationBlock seems almost the same as a span

Open codefromthecrypt opened this issue 8 years ago • 2 comments

AnnotationBlock is a bit confusing to me. Primarily, it encapsulates the duration between send and receive or visa versa. This is the same as Span. For example, Span with kind server or client is the same thing, except without requiring new vocabulary that doesn't match zipkin's model. I'm wondering why the new vocab?

codefromthecrypt avatar May 07 '17 07:05 codefromthecrypt

AnnotationBlock is block of metadata used by Span, holding Endpoint and Start/Stop timestamps. It generates 'annotations' section in span json structure and calculates duration - everything for Span, and is used by Span. I'm thinking about better solution but i have no idea. Maybe method in Span something like $span->setAnnotations($endpoint, $start, $stop(optional,now), $type(optional)) but as long as it is required i think better solution is passing AnnotationBlock in Span constructor to avoid missing data.

Initially it was created to reduce the number of parameters that the Span constructor accepts.

whitemerry avatar May 07 '17 13:05 whitemerry

Might be worthwhile looking at other implementations. Closest to what you have is finagle's annotation filter. Note that that one also can produce an error annotation.

https://github.com/twitter/finagle/blob/d72d11a5eb298bcc005882436af2685a5ce58f08/finagle-core/src/main/scala/com/twitter/finagle/tracing/TraceInitializerFilter.scala#L79

codefromthecrypt avatar May 08 '17 00:05 codefromthecrypt