MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / CountingPropagator

Class CountingPropagator

tests/test_tracing.py:80–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78
79
80class CountingPropagator(TextMapPropagator):
81 def __init__(self) -> None:
82 self.injected = 0
83
84 @override
85 def extract(self, carrier: Any, context: Any = None, getter: Any = None) -> Any:
86 return context
87
88 @override
89 def inject(self, carrier: Any, context: Any = None, setter: Any = None) -> None:
90 self.injected += 1
91 carrier["traceparent"] = TRACEPARENT
92
93 @property
94 @override
95 def fields(self) -> set[str]:
96 return {"traceparent"}
97
98
99class Server:

Callers 1

propagatorFunction · 0.70

Calls

no outgoing calls

Tested by 1

propagatorFunction · 0.56