opentracing/opentracing-python

Non-string tag values are converted to strings

Closed this issue · 4 comments

As far as I can see, the span.set_tag always converts non-string values such as int or bool to string upon storing the value in the tag.

For example if storing a http status code from requests the result tag obj contains a string:

            if r.status_code:
                span.set_tag(tags.HTTP_STATUS_CODE, r.status_code)

screenshot from 2018-09-29 17-29-59

I won't even pretend to understand the complexity of the opentracing library, but we have other systems pushing bool and int-type tags into our Jaeger infrastructure, so at least this should theoretically supported. No idea how to start figuring this one out, so any pointers would be appreciated.

Relevant package versions:

jaeger-client==3.11.0
opentracing==1.3.0

this is an issue for Jaeger library https://github.com/jaegertracing/jaeger-client-python/, not this repo.

thanks for clarifying that @yurishkuro . My reason for posting here is that the start_span and set_tag methods seem to be in this repo, not the Jaeger lib:

with opentracing.tracer.start_span(trace_name, child_of=current_span) as span:

However, happy to post in Jaeger-Client if that's the right place to post this.

The methods here are just an interface.