open-telemetry / opentelemetry-python

OpenTelemetry Python API and SDK
https://opentelemetry.io
Apache License 2.0
1.72k stars 607 forks source link

Documentation request - python opentelemetry-propagator-b3 #2667

Open ColeSiegelTR opened 2 years ago

ColeSiegelTR commented 2 years ago

Hi,

I'm looking to use python opentelemetry-propagator-b3 in order to integrate create custom traces with service mesh traces generated by Istio.

I think in order to do this I need to propagate the b3 headers or assign them into my OpenTelemetry span somehow, but the b3 propagator doesn't do anything when I try the below:

from opentelemetry.propagators.b3 import B3MultiFormat
# https://opentelemetry.io/docs/instrumentation/python/getting-started/#configure-your-http-propagator-b3-baggage
# use B3MultiFormat since thats what istio sends?
set_global_textmap(B3MultiFormat())

Any suggestions or possibly a quick example I could refer to? Thanks!

ColeSiegelTR commented 2 years ago

Maybe it doesn't work because of https://github.com/open-telemetry/opentelemetry-python/issues/2629 ?

srikanthccv commented 2 years ago

@ColeSiegelTR You don't have to do anything except setting the propagator (which you are doing already). What is the issue you are running into? Are you seeing the broken traces?