I was running Opentelemetry 0.18rc1 and my application was working perfectly.
I'm using the W3C Trace Context specification for context propagation. For injection and extraction i used TraceContextTextMapPropagator
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
from opentelemetry.context import get_current
prop = TraceContextTextMapPropagator()
carrier = {}
prop.inject(set_in_carrier=dict.__setitem__, carrier=carrier, context=get_current())
and for extraction in the next micro-service, i used:
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
from opentelemetry.propagators import textmap
prop = TraceContextTextMapPropagator()
carrier_getter = textmap.DictGetter()
context = prop.extract(carrier_getter, request.headers)
When I tried to upgrade to the latest opentelemetry 1.4.0 my injection and extraction methods stopped working. It seems the DictGetter() class was removed from the new version, so i don't know how to set the getter parameter in the extract method. Also, the set_in_carrier was replaced with a setter parameter in the inject method and I'm not sure how to to set this one either.
How do I implement the Inject and Extract methods in opentelemetry 1.4.0 for W3C Trace Context specification?