opentracing/specification

Add Span#isSampled

felixbarny opened this issue · 4 comments

Right now, there is no way to determine wether or not a span is sampled in a tracer implementation independent manner.

Even recording all tags and getting the sampling.priority is not sufficient, as tracer implementations don't necessarily set them explicitly, for example when X-B3-Sampled: 0 is set via a HTTP header.

Use cases:

  1. Adding a tag which is costly to compute only when the span is sampled at all
  2. Implementing a tracer independent span reporter which obviously has to know wether or not a span is sampled

This and also #91 raises the question of wether OT is actually designed to be interoperable. I don't think there is currently enough emphasis on that aspect albeit being one of the main selling points of OT. No blame or offense in this, I'm just a little frustrated.

Hi Felix! I agree as well, on the broad point that SpanContext does not reveal enough of the span's context. Getting people to agree on what more should be exposed (I would add SpanID/TraceID to the list as well) should be the next push forwards with the Specification, IMHO.

However, there's also the TraceContext proposal coming along. If that project is close to getting resolved, I'd like OT SpanContext and TraceContext to align on what they expose, how they name things, etc.

Hi Ted, and thanks for your response! In the mean time, I've found a good workaround for encapsulating tracer specific functionality so I'm ok with waiting a bit longer for a proper solution.

I like the Idea of aligning the TraceContext proposal and OpenTracing. I can't seem to find the GitHub page of the TraceContext repo anymore. Do you have a link for me?

Is this a duplicate of #8 ?