Open castrapel opened 6 years ago
Hey @castrapel
So you need to change this line:
tracer = opentracing.Tracer(scope_manager=TornadoScopeManager())
to actually create a JaegerTracer
, as opentracing.Tracer
is both an interface-alike class and a noop-implementation.
You will also likely need to configure the ports when calling JaegerTracer()
;) Let me know if you need further assistance :)
Thanks for your reply Carlos.
When I pip install jaeger-client
, opentracing 2.0.0 is downgraded to opentracing 1.3.0 ( because of this ), and opentracing 1.3.0 does not have TornadoScopeManager.
So I tried pinning to opentracing 2.0.0, and I try to create a Jaeger tracer with the code below, it doesn't like the scope_manager kwarg. How do I pass in a scope manager to the Jaeger tracer?
from jaeger_client import Config
from opentracing.scope_managers.tornado import TornadoScopeManager
...
config = Config(
config={
'sampler': {
'type': 'const',
'param': 1,
},
'logging': True,
},
service_name='consoleme',
validate=True,
)
tracer = config.initialize_tracer(scope_manager=TornadoScopeManager())
Result: "TypeError: initialize_tracer() got an unexpected keyword argument 'scope_manager'"
(btw your post here was extremely helpful for me to understand scope managers: https://medium.com/opentracing/announcing-python-opentracing-2-0-0-release-f4ee33de25ce )
Hi @carlosalberto , not sure if you saw that last message so I just wanted to send a new notification. Thanks!
Hey @castrapel
So it looks Jaeger does not have a OT 2.0 compliant release yet - you may want to poke them here https://github.com/jaegertracing/jaeger-client-python about that ;)
Correct, I see an issue there already and it looks like progress is being made. In the meantime, though, should python-tornado unpin opentracing from version 2.0? https://github.com/opentracing-contrib/python-tornado/blob/master/setup.py#L18
Unpinning it would mean breaking the current code - but we have a previous release, 0.1.0 that uses the 1.x family (albeit without a few cleanups and fixes).
At the same time, I'd imagine Jaeger moving relatively soon to the 2.0 API.
If you need any clean up that is not in 0.1.0 we could try to back port some changes and do a 0.1.x release ;)
The package info (plus related documentation) lives here, btw: https://pypi.org/project/tornado_opentracing/0.1.0/
An alternative is to use the Jaeger instrumentation itself provides: https://github.com/uber-common/opentracing-python-instrumentation/
Hope that helps!
Hi, I'm having trouble with getting Tornado tracing working in conjunction with the jaegertracing docker image. I'm running my app on Python 3.5
Without any additional configuration, should this work when both services run locally?
Here's my app initializer: ` def make_app(): """make_app.""" .... tracer = opentracing.Tracer(scope_manager=TornadoScopeManager())
`
Here's how I start the jaegertracing docker image:
docker run -d -p5775:5775/udp -p6831:6831/udp -p6832:6832/udp -p5778:5778 -p16686:16686 -p14268:14268 jaegertracing/all-in-one:latest