Skip to content

Commit 93a3242

Browse files
docs: Clarify that instrumenter is internal-only (#3299)
Adjust docstrings of all non-deprecated functions which take an `instrumenter` parameter to state that `instrumenter` is only meant to be used by the SDK, and that it is deprecated for client code. The docstrings also inform users that `instrumenter` will be removed in the next major release.
1 parent 8e3ddf9 commit 93a3242

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

sentry_sdk/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ def start_transaction(
322322
323323
:param transaction: The transaction to start. If omitted, we create and
324324
start a new transaction.
325-
:param instrumenter: This parameter is meant for internal use only.
325+
:param instrumenter: This parameter is meant for internal use only. It
326+
will be removed in the next major version.
326327
:param custom_sampling_context: The transaction's custom sampling context.
327328
:param kwargs: Optional keyword arguments to be passed to the Transaction
328329
constructor. See :py:class:`sentry_sdk.tracing.Transaction` for

sentry_sdk/scope.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,8 @@ def start_transaction(
987987
988988
:param transaction: The transaction to start. If omitted, we create and
989989
start a new transaction.
990-
:param instrumenter: This parameter is meant for internal use only.
990+
:param instrumenter: This parameter is meant for internal use only. It
991+
will be removed in the next major version.
991992
:param custom_sampling_context: The transaction's custom sampling context.
992993
:param kwargs: Optional keyword arguments to be passed to the Transaction
993994
constructor. See :py:class:`sentry_sdk.tracing.Transaction` for
@@ -1054,6 +1055,10 @@ def start_span(self, instrumenter=INSTRUMENTER.SENTRY, **kwargs):
10541055
one is not already in progress.
10551056
10561057
For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Span`.
1058+
1059+
The instrumenter parameter is deprecated for user code, and it will
1060+
be removed in the next major version. Going forward, it should only
1061+
be used by the SDK itself.
10571062
"""
10581063
with new_scope():
10591064
kwargs.setdefault("scope", self)

sentry_sdk/tracing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ def start_child(self, instrumenter=INSTRUMENTER.SENTRY, **kwargs):
394394
Takes the same arguments as the initializer of :py:class:`Span`. The
395395
trace id, sampling decision, transaction pointer, and span recorder are
396396
inherited from the current span/transaction.
397+
398+
The instrumenter parameter is deprecated for user code, and it will
399+
be removed in the next major version. Going forward, it should only
400+
be used by the SDK itself.
397401
"""
398402
configuration_instrumenter = sentry_sdk.Scope.get_client().options[
399403
"instrumenter"

0 commit comments

Comments
 (0)