-
Notifications
You must be signed in to change notification settings - Fork 468
Closed
Description
The docs on injecting the context attributes for propagation of HTTP requests states that the inject() can be called on the HTTPPropagator class as follows:
def parent_call():
with tracer.trace("parent_span") as span:
headers = {}
HTTPPropagator.inject(span.context, headers)
url = "<some RPC endpoint>"
r = requests.get(url, headers=headers)When doing this, I get an error that the method HTTPPropagator.inject() requires an instance to be passed. Looking at the code, inject() is not a classmethod or a staticmethod, and the example should be updated to:
def parent_call():
with tracer.trace("parent_span") as span:
headers = {}
propagator = HTTPPropagator()
propagator.inject(span.context, headers)
url = "<some RPC endpoint>"
r = requests.get(url, headers=headers)The same follows for the extract() method as well.
Kyle-Verhoog