@@ -573,42 +573,6 @@ def set_operation_name(operation_name):
573
573
# Injection and extraction
574
574
575
575
576
- @ensure_active_span ("inject the span into a header" )
577
- def inject_active_span_twisted_headers (headers , destination , check_destination = True ):
578
- """
579
- Injects a span context into twisted headers in-place
580
-
581
- Args:
582
- headers (twisted.web.http_headers.Headers)
583
- destination (str): address of entity receiving the span context. If check_destination
584
- is true the context will only be injected if the destination matches the
585
- opentracing whitelist
586
- check_destination (bool): If false, destination will be ignored and the context
587
- will always be injected.
588
- span (opentracing.Span)
589
-
590
- Returns:
591
- In-place modification of headers
592
-
593
- Note:
594
- The headers set by the tracer are custom to the tracer implementation which
595
- should be unique enough that they don't interfere with any headers set by
596
- synapse or twisted. If we're still using jaeger these headers would be those
597
- here:
598
- https://github.com/jaegertracing/jaeger-client-python/blob/master/jaeger_client/constants.py
599
- """
600
-
601
- if check_destination and not whitelisted_homeserver (destination ):
602
- return
603
-
604
- span = opentracing .tracer .active_span
605
- carrier = {} # type: Dict[str, str]
606
- opentracing .tracer .inject (span .context , opentracing .Format .HTTP_HEADERS , carrier )
607
-
608
- for key , value in carrier .items ():
609
- headers .addRawHeaders (key , value )
610
-
611
-
612
576
@ensure_active_span ("inject the span into a byte dict" )
613
577
def inject_active_span_byte_dict (headers , destination , check_destination = True ):
614
578
"""
@@ -646,38 +610,6 @@ def inject_active_span_byte_dict(headers, destination, check_destination=True):
646
610
headers [key .encode ()] = [value .encode ()]
647
611
648
612
649
- @ensure_active_span ("inject the span into a text map" )
650
- def inject_active_span_text_map (carrier , destination , check_destination = True ):
651
- """
652
- Injects a span context into a dict
653
-
654
- Args:
655
- carrier (dict)
656
- destination (str): address of entity receiving the span context. If check_destination
657
- is true the context will only be injected if the destination matches the
658
- opentracing whitelist
659
- check_destination (bool): If false, destination will be ignored and the context
660
- will always be injected.
661
-
662
- Returns:
663
- In-place modification of carrier
664
-
665
- Note:
666
- The headers set by the tracer are custom to the tracer implementation which
667
- should be unique enough that they don't interfere with any headers set by
668
- synapse or twisted. If we're still using jaeger these headers would be those
669
- here:
670
- https://github.com/jaegertracing/jaeger-client-python/blob/master/jaeger_client/constants.py
671
- """
672
-
673
- if check_destination and not whitelisted_homeserver (destination ):
674
- return
675
-
676
- opentracing .tracer .inject (
677
- opentracing .tracer .active_span .context , opentracing .Format .TEXT_MAP , carrier
678
- )
679
-
680
-
681
613
@ensure_active_span ("get the active span context as a dict" , ret = {})
682
614
def get_active_span_text_map (destination = None ):
683
615
"""
0 commit comments