File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 29
29
import opentracing
30
30
import opentracing .ext .tags
31
31
import lightstep
32
+ from opentracing import Format
33
+ from lightstep .b3_propagator import B3Propagator
32
34
33
35
34
36
class RemoteHandler (BaseHTTPRequestHandler ):
@@ -145,6 +147,12 @@ def lightstep_tracer_from_args():
145
147
if __name__ == '__main__' :
146
148
with lightstep_tracer_from_args () as tracer :
147
149
opentracing .tracer = tracer
150
+
151
+ opentracing .tracer .register_propagator (Format .TEXT_MAP , B3Propagator ())
152
+ opentracing .tracer .register_propagator (
153
+ Format .HTTP_HEADERS , B3Propagator ()
154
+ )
155
+
148
156
global _exit_code
149
157
_exit_code = 0
150
158
Original file line number Diff line number Diff line change 9
9
from __future__ import absolute_import
10
10
11
11
from basictracer import BasicTracer
12
- from lightstep . b3_propagator import B3Propagator
12
+ from basictracer . text_propagator import TextPropagator
13
13
from opentracing import Format
14
14
15
15
from lightstep .lightstep_binary_propagator import LightStepBinaryPropagator
@@ -73,8 +73,8 @@ class _LightstepTracer(BasicTracer):
73
73
def __init__ (self , enable_binary_format , recorder , scope_manager ):
74
74
"""Initialize the LightStep Tracer, deferring to BasicTracer."""
75
75
super (_LightstepTracer , self ).__init__ (recorder , scope_manager = scope_manager )
76
- self .register_propagator (Format .TEXT_MAP , B3Propagator ())
77
- self .register_propagator (Format .HTTP_HEADERS , B3Propagator ())
76
+ self .register_propagator (Format .TEXT_MAP , TextPropagator ())
77
+ self .register_propagator (Format .HTTP_HEADERS , TextPropagator ())
78
78
if enable_binary_format :
79
79
# We do this import lazily because protobuf versioning issues
80
80
# can cause process-level failure at import time.
Original file line number Diff line number Diff line change 5
5
6
6
from opentracing import Format
7
7
from lightstep import Tracer
8
+ from lightstep .b3_propagator import B3Propagator
8
9
9
10
10
11
class B3PropagatorTest (TestCase ):
@@ -13,6 +14,7 @@ def setUp(self):
13
14
periodic_flush_seconds = 0 ,
14
15
collector_host = "localhost"
15
16
)
17
+ self ._tracer .register_propagator (Format .HTTP_HEADERS , B3Propagator ())
16
18
17
19
def tracer (self ):
18
20
return self ._tracer
You can’t perform that action at this time.
0 commit comments