This example https://github.com/opentracing-contrib/python-flask/blob/master/example/server.py#L28 uses the tracer returned by jaeger_client's initialize_tracer method. This method internally sets the opentracing.tracer to jaeger tracer object, this means for any request handler there after can do opentracing.global_tracer().start_span(...) and this sends traces to jaeger
I noticed when i run a flask dev server(using app.run) opentracing.global_tracer() is not the same as jaeger tracer i initialised earlier(as in the the link above) when starting up the server. Is there something i'm missing on flask side?
I could use returned jaeger_tracer from initialize_tracer(), which would mean i'd have to pass this around or create my own process/request local storage. I suppose according to jaeger tracer docs https://github.com/jaegertracing/jaeger-client-python#production, the initialised jaeger tracer must be available via opentracing.global_tracer()
This example https://github.com/opentracing-contrib/python-flask/blob/master/example/server.py#L28 uses the tracer returned by jaeger_client's
initialize_tracermethod. This method internally sets theopentracing.tracerto jaeger tracer object, this means for any request handler there after can doopentracing.global_tracer().start_span(...)and this sends traces to jaegerI noticed when i run a flask dev server(using
app.run)opentracing.global_tracer()is not the same as jaeger tracer i initialised earlier(as in the the link above) when starting up the server. Is there something i'm missing on flask side?I could use returned
jaeger_tracerfrominitialize_tracer(), which would mean i'd have to pass this around or create my own process/request local storage. I suppose according to jaeger tracer docs https://github.com/jaegertracing/jaeger-client-python#production, the initialised jaeger tracer must be available viaopentracing.global_tracer()