Exemplo n.º 1
0
 def join(self, operation_name, format, carrier):
     if format == Format.BINARY:
         return self._binary_propagator.join(operation_name, carrier)
     elif format == Format.TEXT_MAP:
         return self._text_propagator.join(operation_name, carrier)
     else:
         raise UnsupportedFormatException()
Exemplo n.º 2
0
 def inject(self, span, format, carrier):
     if format == Format.BINARY:
         self._binary_propagator.inject(span, carrier)
     elif format == Format.TEXT_MAP:
         self._text_propagator.inject(span, carrier)
     else:
         raise UnsupportedFormatException()
Exemplo n.º 3
0
 def inject(self, span_context, format, carrier):
     codec = self.codecs.get(format, None)
     if codec is None:
         raise UnsupportedFormatException(format)
     if isinstance(span_context, Span):
         # be flexible and allow Span as argument, not only SpanContext
         span_context = span_context.context
     if not isinstance(span_context, SpanContext):
         raise ValueError('Expecting Jaeger SpanContext, not %s',
                          type(span_context))
     codec.inject(span_context=span_context, carrier=carrier)
Exemplo n.º 4
0
 def extract(self, format, carrier):
     codec = self.codecs.get(format, None)
     if codec is None:
         raise UnsupportedFormatException(format)
     return codec.extract(carrier)
Exemplo n.º 5
0
 def extract(self, format, carrier):
     if format in self._propagators:
         return self._propagators[format].extract(carrier)
     else:
         raise UnsupportedFormatException()
Exemplo n.º 6
0
 def inject(self, span_context, format, carrier):
     if format in self._propagators:
         self._propagators[format].inject(span_context, carrier)
     else:
         raise UnsupportedFormatException()