Ejemplo n.º 1
0
 def test_serialize(self):
     local_trace_observer = TraceLocalSpanObserver("test-service",
                                                   "test-component",
                                                   "test-host", self.span,
                                                   self.recorder)
     local_trace_observer.on_start()
     local_trace_observer.on_finish(None)
     serialized_span = local_trace_observer._serialize()
     self.assertIsNotNone(serialized_span["duration"])
     self.assertEqual(serialized_span["name"], self.span.name)
     lc_annotation = serialized_span["binaryAnnotations"][0]
     self.assertEqual(lc_annotation["endpoint"]["serviceName"],
                      "test-service")
     self.assertEqual(lc_annotation["value"], "test-component")
Ejemplo n.º 2
0
 def test_serialize(self):
     local_trace_observer = TraceLocalSpanObserver("test-service",
                                                   "test-component",
                                                   "test-host", self.span,
                                                   self.recorder)
     local_trace_observer.on_start()
     local_trace_observer.on_finish(None)
     serialized_span = local_trace_observer._serialize()
     self.assertIsNotNone(serialized_span["duration"])
     self.assertEqual(serialized_span["name"], self.span.name)
     annotations = serialized_span["binaryAnnotations"]
     for annotation in annotations:
         self.assertTrue("key" in annotation)
         self.assertTrue("value" in annotation)
         self.assertTrue("endpoint" in annotation)
Ejemplo n.º 3
0
 def test_serialize(self):
     local_trace_observer = TraceLocalSpanObserver(
         'test-service',
         'test-component',
         'test-host',
         self.span,
         self.recorder,
     )
     local_trace_observer.on_start()
     local_trace_observer.on_finish(None)
     serialized_span = local_trace_observer._serialize()
     self.assertIsNotNone(serialized_span['duration'])
     self.assertEqual(serialized_span['name'], self.span.name)
     lc_annotation = serialized_span['binaryAnnotations'][0]
     self.assertEqual(lc_annotation['endpoint']['serviceName'], 'test-service')
     self.assertEqual(lc_annotation['value'], 'test-component')
Ejemplo n.º 4
0
 def test_serialize(self):
     local_trace_observer = TraceLocalSpanObserver(
         'test-service',
         'test-component',
         'test-host',
         self.span,
         self.recorder,
     )
     local_trace_observer.on_start()
     local_trace_observer.on_finish(None)
     serialized_span = local_trace_observer._serialize()
     self.assertIsNotNone(serialized_span['duration'])
     self.assertEqual(serialized_span['name'], self.span.name)
     lc_annotation = serialized_span['binaryAnnotations'][0]
     self.assertEqual(lc_annotation['endpoint']['serviceName'], 'test-service')
     self.assertEqual(lc_annotation['value'], 'test-component')