File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
opentelemetry-sdk/src/opentelemetry/sdk/trace Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 8989_ENV_VALUE_UNSET = ""
9090
9191
92- class SpanProcessor :
92+ @typing .runtime_checkable
93+ class SpanProcessor (typing .Protocol ):
9394 """Interface which allows hooks for SDK's `Span` start and end method
9495 invocations.
9596
@@ -112,7 +113,6 @@ def on_start(
112113 span: The :class:`opentelemetry.trace.Span` that just started.
113114 parent_context: The parent context of the span that just started.
114115 """
115- ...
116116
117117 def on_end (self , span : "ReadableSpan" ) -> None :
118118 """Called when a :class:`opentelemetry.trace.Span` is ended.
@@ -123,11 +123,9 @@ def on_end(self, span: "ReadableSpan") -> None:
123123 Args:
124124 span: The :class:`opentelemetry.trace.Span` that just ended.
125125 """
126- ...
127126
128127 def shutdown (self ) -> None :
129128 """Called when a :class:`opentelemetry.sdk.trace.TracerProvider` is shutdown."""
130- ...
131129
132130 def force_flush (self , timeout_millis : int = 30000 ) -> bool :
133131 """Export all ended spans to the configured Exporter that have not yet
@@ -140,7 +138,6 @@ def force_flush(self, timeout_millis: int = 30000) -> bool:
140138 Returns:
141139 False if the timeout is exceeded, True otherwise.
142140 """
143- ...
144141
145142
146143# Temporary fix until https://github.com/PyCQA/pylint/issues/4098 is resolved
Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ class SpanExportResult(Enum):
5151 FAILURE = 1
5252
5353
54- class SpanExporter :
54+ @typing .runtime_checkable
55+ class SpanExporter (typing .Protocol ):
5556 """Interface for exporting spans.
5657
5758 Interface to be implemented by services that want to export spans recorded
@@ -72,21 +73,18 @@ def export(
7273 Returns:
7374 The result of the export
7475 """
75- ...
7676
7777 def shutdown (self ) -> None :
7878 """Shuts down the exporter.
7979
8080 Called when the SDK is shut down.
8181 """
82- ...
8382
8483 def force_flush (self , timeout_millis : int = 30000 ) -> bool :
8584 """Hint to ensure that the export of any spans the exporter has received
8685 prior to the call to ForceFlush SHOULD be completed as soon as possible, preferably
8786 before returning from this method.
8887 """
89- ...
9088
9189
9290class SimpleSpanProcessor (SpanProcessor ):
You can’t perform that action at this time.
0 commit comments