/opt/cloudlinux/venv/lib/python3.11/site-packages/sentry_sdk
NameSizeModeActions
crons/-0755rm
integrations/-0755rm
__pycache__/-0755rm
api.py61920644editdlrm
attachments.py18110644editdlrm
client.py228900644editdlrm
consts.py86970644editdlrm
debug.py11320644editdlrm
envelope.py95910644editdlrm
hub.py270500644editdlrm
monitor.py30370644editdlrm
profiler.py339780644editdlrm
py.typed00644editdlrm
scope.py248440644editdlrm
scrubber.py38930644editdlrm
serializer.py132850644editdlrm
session.py55610644editdlrm
sessions.py59000644editdlrm
tracing.py297390644editdlrm
tracing_utils.py122870644editdlrm
tracing_utils_py2.py12440644editdlrm
tracing_utils_py3.py21460644editdlrm
transport.py185700644editdlrm
utils.py466760644editdlrm
worker.py42540644editdlrm
_compat.py27950644editdlrm
_functools.py49570644editdlrm
_lru_cache.py53900644editdlrm
_queue.py112670644editdlrm
_types.py22470644editdlrm
_werkzeug.py37900644editdlrm
__init__.py10560644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/sentry_sdk/tracing_utils_py3.py (2146B)
import inspect from functools import wraps import sentry_sdk from sentry_sdk import get_current_span from sentry_sdk._types import TYPE_CHECKING from sentry_sdk.consts import OP from sentry_sdk.utils import logger, qualname_from_function if TYPE_CHECKING: from typing import Any def start_child_span_decorator(func): # type: (Any) -> Any """ Decorator to add child spans for functions. This is the Python 3 compatible version of the decorator. For Python 2 there is duplicated code here: ``sentry_sdk.tracing_utils_python2.start_child_span_decorator()``. See also ``sentry_sdk.tracing.trace()``. """ # Asynchronous case if inspect.iscoroutinefunction(func): @wraps(func) async def func_with_tracing(*args, **kwargs): # type: (*Any, **Any) -> Any span = get_current_span(sentry_sdk.Hub.current) if span is None: logger.warning( "Can not create a child span for %s. " "Please start a Sentry transaction before calling this function.", qualname_from_function(func), ) return await func(*args, **kwargs) with span.start_child( op=OP.FUNCTION, description=qualname_from_function(func), ): return await func(*args, **kwargs) # Synchronous case else: @wraps(func) def func_with_tracing(*args, **kwargs): # type: (*Any, **Any) -> Any span = get_current_span(sentry_sdk.Hub.current) if span is None: logger.warning( "Can not create a child span for %s. " "Please start a Sentry transaction before calling this function.", qualname_from_function(func), ) return func(*args, **kwargs) with span.start_child( op=OP.FUNCTION, description=qualname_from_function(func), ): return func(*args, **kwargs) return func_with_tracing