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 @@
# type: () -> str
return self.__class__.__name__

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

Check warning on line 882 in sentry_sdk/tracing.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/tracing.py#L882

Added line #L882 was not covered by tests

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

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

Check warning on line 902 in sentry_sdk/tracing.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/tracing.py#L902

Added line #L902 was not covered by tests

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

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

Check warning on line 942 in sentry_sdk/tracing.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/tracing.py#L942

Added line #L942 was not covered by tests

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

Check warning on line 946 in sentry_sdk/tracing.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/tracing.py#L946

Added line #L946 was not covered by tests

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

Check warning on line 950 in sentry_sdk/tracing.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/tracing.py#L950

Added line #L950 was not covered by tests

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

Check warning on line 954 in sentry_sdk/tracing.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/tracing.py#L954

Added line #L954 was not covered by tests


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