Skip to content

Commit 4702caa

Browse files
authored
ref: Remove old OTel support code (#6935)
- Remove everything in `integrations/opentelemetry` (`SentrySpanProcessor`, `SentryPropagator`, etc.) - Remove associated test files and CI config - Move old propagator functions and consts that we were using in `OTLPIntegration` to the OTLP propagator directly - Remove `instrumenter` Note: `NoOpSpan` was not removed because it makes mypy blow up. Not worth the effort as we'll anyway get rid of it when dropping transaction based tracing. #### Issues Closes #6932
1 parent 17094d7 commit 4702caa

23 files changed

Lines changed: 77 additions & 1657 deletions

File tree

.github/workflows/test-integrations-misc.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ jobs:
4141
run: |
4242
set -x # print commands that are executed
4343
./scripts/runtox.sh "py${{ matrix.python-version }}-loguru"
44-
- name: Test opentelemetry
45-
run: |
46-
set -x # print commands that are executed
47-
./scripts/runtox.sh "py${{ matrix.python-version }}-opentelemetry"
4844
- name: Test otlp
4945
run: |
5046
set -x # print commands that are executed

MIGRATION_GUIDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
2828

2929
- Transaction profiling and related code was removed.
3030
- Removed the deprecated Hub class and all uses of hub throughout the SDK in arguments, options, etc. Use a scope instead.
31+
- The `SentrySpanProcessor`, `SentryPropagator`, `instrumenter`, and associated OpenTelemetry compatibility code was removed along with the `opentelemetry` extra and the `SentryPropagator` entrypoint. Use the `OTLPIntegration` instead.
3132
- Removed the `auto_session_tracing` decorator. Use `track_session` instead.
3233
- The experimental option `otel_powered_performance` has been removed together with the associated `OpenTelemetryIntegration` and `opentelemetry-experimental` extra.
3334

scripts/populate_tox/populate_tox.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"shadowed_module",
7070
"gcp",
7171
"gevent",
72-
"opentelemetry",
7372
"otlp",
7473
}
7574

scripts/populate_tox/tox.jinja

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ envlist =
4242
# GCP
4343
{py3.7}-gcp
4444

45-
# OpenTelemetry (OTel)
46-
{py3.7,py3.9,py3.12,py3.13,py3.14,py3.14t}-opentelemetry
47-
4845
# OpenTelemetry with OTLP
4946
{py3.7,py3.9,py3.12,py3.13,py3.14}-otlp
5047

@@ -136,10 +133,6 @@ deps =
136133
aws_lambda: uvicorn
137134
aws_lambda: pyyaml
138135

139-
# OpenTelemetry (OTel)
140-
opentelemetry: opentelemetry-distro
141-
opentelemetry: pytest-forked
142-
143136
# OpenTelemetry with OTLP
144137
otlp: opentelemetry-distro[otlp]
145138
otlp: responses
@@ -233,7 +226,6 @@ setenv =
233226
aws_lambda: _TESTPATH=tests/integrations/aws_lambda
234227
cloud_resource_context: _TESTPATH=tests/integrations/cloud_resource_context
235228
gcp: _TESTPATH=tests/integrations/gcp
236-
opentelemetry: _TESTPATH=tests/integrations/opentelemetry
237229
otlp: _TESTPATH=tests/integrations/otlp
238230
socket: _TESTPATH=tests/integrations/socket
239231

scripts/split_tox_gh_actions/split_tox_gh_actions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@
163163
],
164164
"Misc": [
165165
"loguru",
166-
"opentelemetry",
167166
"otlp",
168167
"pure_eval",
169168
"trytond",

sentry_sdk/api.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from sentry_sdk import Client, tracing_utils
77
from sentry_sdk._init_implementation import init
8-
from sentry_sdk.consts import INSTRUMENTER
98
from sentry_sdk.crons import monitor
109
from sentry_sdk.scope import Scope, _ScopeManager, isolation_scope, new_scope
1110
from sentry_sdk.traces import StreamedSpan
@@ -383,7 +382,6 @@ def start_span(
383382
@scopemethod
384383
def start_transaction(
385384
transaction: "Optional[Transaction]" = None,
386-
instrumenter: str = INSTRUMENTER.SENTRY,
387385
custom_sampling_context: "Optional[SamplingContext]" = None,
388386
**kwargs: "Unpack[TransactionKwargs]",
389387
) -> "Union[Transaction, NoOpSpan]":
@@ -411,15 +409,13 @@ def start_transaction(
411409
412410
:param transaction: The transaction to start. If omitted, we create and
413411
start a new transaction.
414-
:param instrumenter: This parameter is meant for internal use only. It
415-
will be removed in the next major version.
416412
:param custom_sampling_context: The transaction's custom sampling context.
417413
:param kwargs: Optional keyword arguments to be passed to the Transaction
418414
constructor. See :py:class:`sentry_sdk.tracing.Transaction` for
419415
available arguments.
420416
"""
421417
return get_current_scope().start_transaction(
422-
transaction, instrumenter, custom_sampling_context, **kwargs
418+
transaction, custom_sampling_context, **kwargs
423419
)
424420

425421

sentry_sdk/client.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from sentry_sdk.consts import (
1818
DEFAULT_MAX_VALUE_LENGTH,
1919
DEFAULT_OPTIONS,
20-
INSTRUMENTER,
2120
SPANDATA,
2221
SPANSTATUS,
2322
VERSION,
@@ -331,9 +330,6 @@ def _get_options(*args: "Optional[str]", **kwargs: "Any") -> "Dict[str, Any]":
331330
if rv["server_name"] is None and hasattr(socket, "gethostname"):
332331
rv["server_name"] = socket.gethostname()
333332

334-
if rv["instrumenter"] is None:
335-
rv["instrumenter"] = INSTRUMENTER.SENTRY
336-
337333
if rv["project_root"] is None:
338334
try:
339335
project_root = os.getcwd()

sentry_sdk/consts.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ def __str__(self) -> str:
113113
return self.value
114114

115115

116-
class INSTRUMENTER:
117-
SENTRY = "sentry"
118-
OTEL = "otel"
119-
120-
121116
class SPANNAME:
122117
DB_COMMIT = "COMMIT"
123118
DB_ROLLBACK = "ROLLBACK"
@@ -1309,7 +1304,6 @@ def __init__(
13091304
send_client_reports: bool = True,
13101305
_experiments: "Experiments" = {}, # noqa: B006
13111306
proxy_headers: "Optional[Dict[str, str]]" = None,
1312-
instrumenter: "Optional[str]" = INSTRUMENTER.SENTRY,
13131307
before_send_transaction: "Optional[TransactionProcessor]" = None,
13141308
project_root: "Optional[str]" = None,
13151309
enable_tracing: "Optional[bool]" = None,
@@ -1716,7 +1710,6 @@ def __init__(
17161710
17171711
:param spotlight:
17181712
1719-
:param instrumenter:
17201713
17211714
:param enable_logs: Set `enable_logs` to True to enable the SDK to emit
17221715
Sentry logs. Defaults to False.

sentry_sdk/integrations/opentelemetry/__init__.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

sentry_sdk/integrations/opentelemetry/consts.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)