Skip to content

Commit 2e71de8

Browse files
docs: Move transaction __init__ doc comment content (#2918)
This change moves the Transaction constructor's parameter doctsring from the __init__ method to the class's docstring. This way, the API docs display the parameter descriptions under the class. When the docstring is defined on __init__, the parameter descriptions are missing from the API docs. This change also documents the kwargs parameter in the API docs. ref getsentry/sentry-docs#5082
1 parent 3ad70b0 commit 2e71de8

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

sentry_sdk/tracing.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,21 @@ def get_trace_context(self):
546546

547547
class Transaction(Span):
548548
"""The Transaction is the root element that holds all the spans
549-
for Sentry performance instrumentation."""
549+
for Sentry performance instrumentation.
550+
551+
:param name: Identifier of the transaction.
552+
Will show up in the Sentry UI.
553+
:param parent_sampled: Whether the parent transaction was sampled.
554+
If True this transaction will be kept, if False it will be discarded.
555+
:param baggage: The W3C baggage header value.
556+
(see https://www.w3.org/TR/baggage/)
557+
:param source: A string describing the source of the transaction name.
558+
This will be used to determine the transaction's type.
559+
See https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations
560+
for more information. Default "custom".
561+
:param kwargs: Additional arguments to be passed to the Span constructor.
562+
See :py:class:`sentry_sdk.tracing.Span` for available arguments.
563+
"""
550564

551565
__slots__ = (
552566
"name",
@@ -569,19 +583,6 @@ def __init__(
569583
**kwargs, # type: Unpack[SpanKwargs]
570584
):
571585
# type: (...) -> None
572-
"""Constructs a new Transaction.
573-
574-
:param name: Identifier of the transaction.
575-
Will show up in the Sentry UI.
576-
:param parent_sampled: Whether the parent transaction was sampled.
577-
If True this transaction will be kept, if False it will be discarded.
578-
:param baggage: The W3C baggage header value.
579-
(see https://www.w3.org/TR/baggage/)
580-
:param source: A string describing the source of the transaction name.
581-
This will be used to determine the transaction's type.
582-
See https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations
583-
for more information. Default "custom".
584-
"""
585586

586587
super().__init__(**kwargs)
587588

0 commit comments

Comments
 (0)