def test_set_custom_propagator(self): reload(propagate) _configure_tracing(_Options()) propagator = get_global_textmap() self.assertIsInstance(propagator, CompositePropagator) propagators = propagator._propagators # pylint: disable=protected-access self.assertEqual(len(propagators), 1) self.assertIsInstance(propagators[0], W3CBaggagePropagator)
def test_sets_tracecontext_and_baggage_are_default_propagator(self): reload(propagate) _configure_tracing(_Options()) propagator = get_global_textmap() self.assertIsInstance(propagator, CompositePropagator) propagators = propagator._propagators # pylint: disable=protected-access self.assertEqual(len(propagators), 2) self.assertIsInstance(propagators[0], TraceContextTextMapPropagator) self.assertIsInstance(propagators[1], W3CBaggagePropagator)
def _configure(self, **kwargs: Dict[str, Any]) -> None: if self._tracing_enabled: _configure_tracing(_Options())
def test_server_timing_is_global_response_propagator_disabled_env(self): _configure_tracing(_Options()) self.assertIsNone(get_global_response_propagator())
def test_server_timing_is_global_response_propagator_disabled_code(self): _configure_tracing(_Options(trace_response_header_enabled=False)) self.assertIsNone(get_global_response_propagator())
def test_server_timing_is_default_response_propagator(self): _configure_tracing(_Options()) propagtor = get_global_response_propagator() self.assertIsInstance(propagtor, _ServerTimingResponsePropagator)
def test_sets_b3_is_global_propagator(self): _configure_tracing(Options()) propagtor = get_global_textmap() self.assertIsInstance(propagtor, B3Format)
def _configure(self, **kwargs: Dict[str, Any]) -> None: _configure_tracing(Options())