Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made NoOpSpan compatible to Transactions. #2364

Merged
merged 7 commits into from
Sep 12, 2023
25 changes: 25 additions & 0 deletions sentry_sdk/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,11 @@ def __repr__(self):
# type: () -> str
return self.__class__.__name__

@property
def containing_transaction(self):
# type: () -> Optional[Transaction]
return None

def start_child(self, instrumenter=INSTRUMENTER.SENTRY, **kwargs):
# type: (str, **Any) -> NoOpSpan
return NoOpSpan()
Expand All @@ -892,6 +897,10 @@ def to_baggage(self):
# type: () -> Optional[Baggage]
return None

def get_baggage(self):
# type: () -> Optional[Baggage]
return None

def iter_headers(self):
# type: () -> Iterator[Tuple[str, str]]
return iter(())
Expand Down Expand Up @@ -928,6 +937,22 @@ def finish(self, hub=None, end_timestamp=None):
# type: (Optional[sentry_sdk.Hub], Optional[datetime]) -> Optional[str]
pass

def set_measurement(self, name, value, unit=""):
# type: (str, float, MeasurementUnit) -> None
pass

def set_context(self, key, value):
# type: (str, Any) -> None
pass

def init_span_recorder(self, maxlen):
# type: (int) -> None
pass

def _set_initial_sampling_decision(self, sampling_context):
# type: (SamplingContext) -> None
pass


def trace(func=None):
# type: (Any) -> Any
Expand Down