/opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations
NameSizeModeActions
django/-0755rm
__pycache__/-0755rm
aiohttp.py38890644editdlrm
argv.py8940644editdlrm
atexit.py14900644editdlrm
aws_lambda.py67580644editdlrm
bottle.py55270644editdlrm
celery.py44230644editdlrm
dedupe.py10850644editdlrm
excepthook.py13350644editdlrm
flask.py72720644editdlrm
gnu_backtrace.py30080644editdlrm
logging.py60190644editdlrm
modules.py12390644editdlrm
pyramid.py59140644editdlrm
rq.py32730644editdlrm
sanic.py70650644editdlrm
serverless.py12380644editdlrm
stdlib.py18690644editdlrm
threading.py15970644editdlrm
tornado.py63870644editdlrm
wsgi.py72990644editdlrm
_wsgi_common.py36660644editdlrm
__init__.py42360644editdlrm
Edit: /opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations/stdlib.py (1869B)
from sentry_sdk.hub import Hub from sentry_sdk.integrations import Integration try: from httplib import HTTPConnection # type: ignore except ImportError: from http.client import HTTPConnection class StdlibIntegration(Integration): identifier = "stdlib" @staticmethod def setup_once(): # type: () -> None install_httplib() def install_httplib(): # type: () -> None real_putrequest = HTTPConnection.putrequest real_getresponse = HTTPConnection.getresponse def putrequest(self, method, url, *args, **kwargs): rv = real_putrequest(self, method, url, *args, **kwargs) if Hub.current.get_integration(StdlibIntegration) is None: return rv self._sentrysdk_data_dict = data = {} host = self.host port = self.port default_port = self.default_port real_url = url if not real_url.startswith(("http://", "https://")): real_url = "%s://%s%s%s" % ( default_port == 443 and "https" or "http", host, port != default_port and ":%s" % port or "", url, ) data["url"] = real_url data["method"] = method return rv def getresponse(self, *args, **kwargs): rv = real_getresponse(self, *args, **kwargs) hub = Hub.current if hub.get_integration(StdlibIntegration) is None: return rv data = getattr(self, "_sentrysdk_data_dict", None) or {} if "status_code" not in data: data["status_code"] = rv.status data["reason"] = rv.reason hub.add_breadcrumb( type="http", category="httplib", data=data, hint={"httplib_response": rv} ) return rv HTTPConnection.putrequest = putrequest HTTPConnection.getresponse = getresponse