def setUpClass(cls): generator = id_generator.RandomIdGenerator() cls.trace_id = generator.generate_trace_id() cls.span_id = generator.generate_span_id() cls.parent_span_id = generator.generate_span_id() cls.serialized_uber_trace_id = jaeger._format_uber_trace_id( # pylint: disable=protected-access cls.trace_id, cls.span_id, cls.parent_span_id, 11)
def test_sample_debug_flags_unset(self): uber_trace_id = jaeger._format_uber_trace_id( # pylint: disable=protected-access self.trace_id, self.span_id, self.parent_span_id, 0) old_carrier = {FORMAT.TRACE_ID_KEY: uber_trace_id} _, new_carrier = get_context_new_carrier(old_carrier) flags = int(new_carrier[FORMAT.TRACE_ID_KEY].split(":")[3]) sample_flag_value = flags & 0x01 debug_flag_value = flags & FORMAT.DEBUG_FLAG self.assertEqual(0, sample_flag_value) self.assertEqual(0, debug_flag_value)