Skip to content

Commit c4c6aac

Browse files
Merge branch 'main' into logs-api-accept-otel-context
2 parents eb28a8d + 347bfae commit c4c6aac

File tree

5 files changed

+19
-3
lines changed

5 files changed

+19
-3
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
sdk-benchmarks:
9-
runs-on: self-hosted
9+
runs-on: equinix-bare-metal
1010
steps:
1111
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
1212
uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- opentelemetry-sdk: Fix invalid `type: ignore` that causes mypy to ignore the whole file
11+
([#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))
14+
1015
## Version 1.34.0/0.55b0 (2025-06-04)
1116

1217
- typecheck: add sdk/resources and drop mypy

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)