Skip to content

Commit d82b183

Browse files
authored
Merge branch 'main' into retry2
2 parents ec3fe9c + 36ac612 commit d82b183

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
A +/-20% jitter was added to all backoffs. A pointless 32 second sleep that occurred after all retries
1212
had completed/failed was removed.
1313
([#4564](https://github.com/open-telemetry/opentelemetry-python/pull/4564)).
14+
- opentelemetry-sdk: Fix invalid `type: ignore` that causes mypy to ignore the whole file
15+
([#4618](https://github.com/open-telemetry/opentelemetry-python/pull/4618))
16+
- Add `span_exporter` property back to `BatchSpanProcessor` class
17+
([#4621](https://github.com/open-telemetry/opentelemetry-python/pull/4621))
1418

1519
## Version 1.34.0/0.55b0 (2025-06-04)
1620

opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# type: ignore[reportDeprecated] # ResourceAttributes is deprecated
16-
1715
"""
1816
This package implements `OpenTelemetry Resources
1917
<https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#resource-sdk>`_:
@@ -58,6 +56,9 @@
5856
above example.
5957
"""
6058

59+
# ResourceAttributes is deprecated
60+
# pyright: reportDeprecated=false
61+
6162
import abc
6263
import concurrent.futures
6364
import logging

opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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:

opentelemetry-sdk/tests/trace/export/test_export.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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.
152152
class 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
{

0 commit comments

Comments
 (0)