PATH:
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
/
integrations
import sys from functools import wraps from typing import TYPE_CHECKING import sentry_sdk from sentry_sdk.utils import event_from_exception, reraise if TYPE_CHECKING: from typing import Any, Callable, Optional, TypeVar, Union, overload F = TypeVar("F", bound=Callable[..., Any]) else: def overload(x: "F") -> "F": return x @overload def serverless_function(f: "F", flush: bool = True) -> "F": pass @overload def serverless_function(f: None = None, flush: bool = True) -> "Callable[[F], F]": # noqa: F811 pass def serverless_function( # noqa f: "Optional[F]" = None, flush: bool = True ) -> "Union[F, Callable[[F], F]]": def wrapper(f: "F") -> "F": @wraps(f) def inner(*args: "Any", **kwargs: "Any") -> "Any": with sentry_sdk.isolation_scope() as scope: scope.clear_breadcrumbs() try: return f(*args, **kwargs) except Exception: _capture_and_reraise() finally: if flush: sentry_sdk.flush() return inner # type: ignore if f is None: return wrapper else: return wrapper(f) def _capture_and_reraise() -> None: exc_info = sys.exc_info() client = sentry_sdk.get_client() if client.is_active(): event, hint = event_from_exception( exc_info, client_options=client.options, mechanism={"type": "serverless", "handled": False}, ) sentry_sdk.capture_event(event, hint=hint) reraise(*exc_info)
[-] tornado.py
[edit]
[-] httpx2.py
[edit]
[-] launchdarkly.py
[edit]
[+]
pydantic_ai
[-] strawberry.py
[edit]
[-] falcon.py
[edit]
[+]
grpc
[-] litestar.py
[edit]
[-] logging.py
[edit]
[-] pymongo.py
[edit]
[-] wsgi.py
[edit]
[-] asyncio.py
[edit]
[-] excepthook.py
[edit]
[-] _wsgi_common.py
[edit]
[-] trytond.py
[edit]
[-] pure_eval.py
[edit]
[-] starlette.py
[edit]
[-] rq.py
[edit]
[-] modules.py
[edit]
[-] rust_tracing.py
[edit]
[-] stdlib.py
[edit]
[-] dramatiq.py
[edit]
[+]
openai_agents
[-] threading.py
[edit]
[-] aiohttp.py
[edit]
[-] arq.py
[edit]
[+]
celery
[-] starlite.py
[edit]
[-] sqlalchemy.py
[edit]
[+]
__pycache__
[-] graphene.py
[edit]
[-] sanic.py
[edit]
[-] anthropic.py
[edit]
[-] langgraph.py
[edit]
[+]
opentelemetry
[-] statsig.py
[edit]
[-] openfeature.py
[edit]
[-] ariadne.py
[edit]
[-] asyncpg.py
[edit]
[-] ray.py
[edit]
[-] openai.py
[edit]
[-] typer.py
[edit]
[-] cohere.py
[edit]
[-] mcp.py
[edit]
[+]
..
[-] huggingface_hub.py
[edit]
[-] chalice.py
[edit]
[-] dedupe.py
[edit]
[-] aws_lambda.py
[edit]
[-] boto3.py
[edit]
[-] loguru.py
[edit]
[-] argv.py
[edit]
[-] gql.py
[edit]
[-] pyramid.py
[edit]
[-] asgi.py
[edit]
[-] serverless.py
[edit]
[-] atexit.py
[edit]
[-] gnu_backtrace.py
[edit]
[-] socket.py
[edit]
[-] langchain.py
[edit]
[-] httpx.py
[edit]
[-] gcp.py
[edit]
[-] otlp.py
[edit]
[+]
django
[-] fastapi.py
[edit]
[-] flask.py
[edit]
[+]
google_genai
[-] _asgi_common.py
[edit]
[-] clickhouse_driver.py
[edit]
[+]
redis
[-] aiomysql.py
[edit]
[-] executing.py
[edit]
[-] __init__.py
[edit]
[-] quart.py
[edit]
[-] beam.py
[edit]
[+]
spark
[-] unraisablehook.py
[edit]
[-] bottle.py
[edit]
[-] litellm.py
[edit]
[-] pyreqwest.py
[edit]
[-] sys_exit.py
[edit]
[-] huey.py
[edit]
[-] unleash.py
[edit]
[-] cloud_resource_context.py
[edit]