Skip to content

Commit

Permalink
docs: Clarify that instrumenter is internal-only
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
szokeasaurusrex committed Jul 19, 2024
1 parent 8e3ddf9 commit 825b2b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sentry_sdk/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ def start_transaction(
:param transaction: The transaction to start. If omitted, we create and
start a new transaction.
:param instrumenter: This parameter is meant for internal use only.
:param instrumenter: This parameter is meant for internal use only. It
will be removed in the next major version.
:param custom_sampling_context: The transaction's custom sampling context.
:param kwargs: Optional keyword arguments to be passed to the Transaction
constructor. See :py:class:`sentry_sdk.tracing.Transaction` for
Expand Down
7 changes: 6 additions & 1 deletion sentry_sdk/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,8 @@ def start_transaction(
:param transaction: The transaction to start. If omitted, we create and
start a new transaction.
:param instrumenter: This parameter is meant for internal use only.
:param instrumenter: This parameter is meant for internal use only. It
will be removed in the next major version.
:param custom_sampling_context: The transaction's custom sampling context.
:param kwargs: Optional keyword arguments to be passed to the Transaction
constructor. See :py:class:`sentry_sdk.tracing.Transaction` for
Expand Down Expand Up @@ -1054,6 +1055,10 @@ def start_span(self, instrumenter=INSTRUMENTER.SENTRY, **kwargs):
one is not already in progress.
For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Span`.
The instrumenter parameter is deprecated for user code, and it will
be removed in the next major version. Going forward, it should only
be used by the SDK itself.
"""
with new_scope():
kwargs.setdefault("scope", self)
Expand Down
4 changes: 4 additions & 0 deletions sentry_sdk/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ def start_child(self, instrumenter=INSTRUMENTER.SENTRY, **kwargs):
Takes the same arguments as the initializer of :py:class:`Span`. The
trace id, sampling decision, transaction pointer, and span recorder are
inherited from the current span/transaction.
The instrumenter parameter is deprecated for user code, and it will
be removed in the next major version. Going forward, it should only
be used by the SDK itself.
"""
configuration_instrumenter = sentry_sdk.Scope.get_client().options[
"instrumenter"
Expand Down

0 comments on commit 825b2b9

Please sign in to comment.