Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix opentracing 0.32.0 #91

Closed
tanumats opened this issue Nov 9, 2018 · 14 comments · Fixed by #93
Closed

Fix opentracing 0.32.0 #91

tanumats opened this issue Nov 9, 2018 · 14 comments · Fixed by #93

Comments

@tanumats
Copy link

tanumats commented Nov 9, 2018

Version 0.32.0 of opentracing has been released.
Please reflect.
https://github.com/opentracing/opentracing-java/releases/tag/release-0.32.0-RC1

Changes
opentracing/opentracing-java#314

@codefromthecrypt
Copy link
Contributor

looks like still some changes going on https://github.com/opentracing/opentracing-java/commits/v0.32.0

are you able to raise a pull request for this?

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented Mar 29, 2019

this is now released.. there are some problems to deal with as I just now looked at this cc @felixbarny @tylerbenson

for example, OT has no sampling api (still) and we are supposed to interpret Tags.SAMPLING_PRIORITY as a sampling hint. We also play games with the kind tag to figure out if we should share a span ID or not.

this is an issue with the new deferred io.opentracing.tag.Tag api. There's no docs on that type, but presume any tags could be done. For example, we interpret tags on set.. for example, looking if it is a number if it corresponds to the sampling tag when hydrating the builder. However, the signature of the type includes Span, not SpanBuilder. The trick is we'd prefer to know if we are supposed to sample a span before we create one. Allowing Tag to be passed to a builder knowing it has to be attributed to Spans, not builders, creates a problem here.

One way is to make a dummy span implementation that catches the result of Tag.set so that we can inspect the value as if it were made with SpanBuilder directly. For example, if the key matches sampling, we use a special dummy span to record the result of Tag.set similar to how mock libraries work. Then, we can get the value of sampling before we create a span.

Another is for OT to evaluate this api and if it is really appropriate to add to span builder, adding docs around why. I can guess, but I'd like to understand this and I'm sure others would too.

Even better would be to stop doing sampling as a vaguely interpreted flag.

@codefromthecrypt
Copy link
Contributor

significantly revised the text of the above comment

@codefromthecrypt
Copy link
Contributor

PS I'm not sure I agree with the design here, but if one were to try to fix the api you could overload set with a SpanBuilder param.

That way, there's no race and it has parity between the two call sites that are eventually invoked (Span.setTag, SpanBuilder.withTag)

@tylerbenson
Copy link

tylerbenson commented Mar 29, 2019

@adriancole I'm a bit confused... what changed in 0.32.0 that is raising this concern? As far as I can tell, the API's you mentioned have been in place for a long time (Tags.SAMPLING_PRIORITY).

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented Mar 30, 2019 via email

@codefromthecrypt
Copy link
Contributor

@tylerbenson more literally below:

  @Override public <T> BraveSpanBuilder withTag(Tag<T> tag, T value) {
    // Assuming Tag implementations are only allowed to call span.setTag with the given key once?
    // We could make a dummy span captor impl to catch the value as we have a builder, not span here.
    // The tag could be a pseudo-api (ex sampling priority) desirable prior to building a span.
    // 
    //  public interface Tag<T> {
    //    String getKey();
    //    void set(Span span, T value);
    //  }
    return this;
  }

@codefromthecrypt
Copy link
Contributor

I will later raise a pull request to show the impact of this design

@codefromthecrypt
Copy link
Contributor

added an issue about the tag builder api opentracing/opentracing-java#340

@codefromthecrypt
Copy link
Contributor

added this about things still missing from span context opentracing/opentracing-java#341

@codefromthecrypt
Copy link
Contributor

note: 0.32 doesn't remove any deprecated code, so that means 0.33 will be a pro and a con. pro is code deleted, con is api break again opentracing/opentracing-java#338

@hochraldo
Copy link

Any news on this? opentracing 0.33 is already out. Any plans to support this in the near future?

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented Jun 24, 2019 via email

@codefromthecrypt
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants