File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
src/opentelemetry/sdk/trace/export Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
1010- opentelemetry-sdk: Fix invalid ` type: ignore ` that causes mypy to ignore the whole file
1111 ([ #4618 ] ( https://github.com/open-telemetry/opentelemetry-python/pull/4618 ) )
12+ - Add ` span_exporter ` property back to ` BatchSpanProcessor ` class
13+ ([ #4621 ] ( https://github.com/open-telemetry/opentelemetry-python/pull/4621 ) )
1214
1315## Version 1.34.0/0.55b0 (2025-06-04)
1416
Original file line number Diff line number Diff line change @@ -177,6 +177,11 @@ def __init__(
177177 "Span" ,
178178 )
179179
180+ # Added for backward compatibility. Not recommended to directly access/use underlying exporter.
181+ @property
182+ def span_exporter (self ):
183+ return self ._batch_processor ._exporter # pylint: disable=protected-access
184+
180185 def on_start (
181186 self , span : Span , parent_context : Context | None = None
182187 ) -> None :
Original file line number Diff line number Diff line change @@ -150,6 +150,11 @@ def test_simple_span_processor_not_sampled(self):
150150# before the end of the test, otherwise the worker thread will continue
151151# to run after the end of the test.
152152class TestBatchSpanProcessor (unittest .TestCase ):
153+ def test_get_span_exporter (self ):
154+ exporter = MySpanExporter (destination = [])
155+ batch_span_processor = export .BatchSpanProcessor (exporter )
156+ self .assertEqual (exporter , batch_span_processor .span_exporter )
157+
153158 @mock .patch .dict (
154159 "os.environ" ,
155160 {
You can’t perform that action at this time.
0 commit comments