-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support opentracing-api 0.32 and 0.33 #93
Conversation
if we know the type are limited to predefined ones then yes we can do
instance of string, number, boolean
I dont know the scope of this Tag api, for example if it means to allow you
to parse an exception or socket address into a string.
…On Tue, Apr 2, 2019, 2:15 PM Felix Barnsteiner ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/main/java/brave/opentracing/BraveSpanBuilder.java
<#93 (comment)>
:
> @@ -88,6 +89,11 @@
return withTag(key, value.toString());
}
+ @OverRide public <T> BraveSpanBuilder withTag(Tag<T> tag, T value) {
+ new TagSetterHack<>(this, tag, value);
Why can't you do withTag(tag.getKey(), value)? Is it because you don't
know of which instance the value is? Could you do instanceof checks?
Anyway, adding void set(SpanBuilder s, T value); to Tag sounds like a
good solution. Maybe even something like void set(Taggable s, T value);
where Span and SpanBuilder implement Taggable. (just brainstorming here)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#93 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD617x7pd_CsBvkuu3cmLDD7fITO9Hlks5vcwOpgaJpZM4cXQxk>
.
|
AFAICT, It's meant to be only string, number and boolean. But you are right, nothing stops anyone from creating a |
Ok I will change this to throw IllegalArgumentException (also should be defined on the Tag javadoc) when the input is neither string, number, boolean. Thanks @felixbarny |
@felixbarny you beat me to it... This was going to be my suggestion. 😉 |
I will pick this up again tomorrow and cut a release that works ideally up to 0.33 as it will be hard to find a precise version everyone will use uniformly. The general idea is to use the approach of not adding |
knackered due to all the re-releasing.. openzipkin/zipkin#2629 will try this again tomorrow. |
fb08dc2
to
e1a9676
Compare
ps it is impossible to make a version that works both with 0.31 and 0.32 due to overloading
this would only work if it was a different method name.. because they OT the same method name for this useless addition, it is impossible to compile against both 0.32 and 0.31. You end up with
This is something we learned a long time ago in brave, as we made a similar mistake. openzipkin/brave#598 |
e1a9676
to
058510d
Compare
It is very likely people will misconfigure their classpaths as there are compatibility issues between versions of opentracing. This raises the following message to tell people one way to resolve it. > OpenTracing 0.31 detected. This version is compatible with io.opentracing:opentracing-api 0.32 or 0.33. Use latest io.opentracing.brave:brave-opentracing:0.33 or update you opentracing-api
Added error when opentracing 0.31 is present. cc @trustin @marcingrzejszczak
|
Added notes about this |
This updates to opentracing 0.32 and 0.33
Here are the following notes:
setTag
andwithTag
with the typeTag
which doesn't exist in 0.31. creating an unresolvable compile conflict.Fixes #91