/opt/cloudlinux/venv/lib/python3.11/site-packages/sentry_sdk/integrations
NameSizeModeActions
django/-0755rm
grpc/-0755rm
opentelemetry/-0755rm
redis/-0755rm
spark/-0755rm
__pycache__/-0755rm
aiohttp.py115530644editdlrm
argv.py9630644editdlrm
arq.py67370644editdlrm
asgi.py118210644editdlrm
asyncio.py30490644editdlrm
atexit.py18460644editdlrm
aws_lambda.py158150644editdlrm
beam.py56890644editdlrm
boto3.py45420644editdlrm
bottle.py64710644editdlrm
celery.py191000644editdlrm
chalice.py47690644editdlrm
cloud_resource_context.py67550644editdlrm
dedupe.py11840644editdlrm
excepthook.py22600644editdlrm
executing.py20410644editdlrm
falcon.py79840644editdlrm
fastapi.py44960644editdlrm
flask.py79070644editdlrm
gcp.py82130644editdlrm
gnu_backtrace.py29300644editdlrm
httpx.py50050644editdlrm
huey.py47000644editdlrm
logging.py91810644editdlrm
loguru.py30510644editdlrm
modules.py21100644editdlrm
pure_eval.py45540644editdlrm
pymongo.py60070644editdlrm
pyramid.py74420644editdlrm
quart.py73770644editdlrm
rq.py54110644editdlrm
sanic.py113260644editdlrm
serverless.py19750644editdlrm
socket.py29450644editdlrm
sqlalchemy.py42440644editdlrm
starlette.py232110644editdlrm
starlite.py100890644editdlrm
stdlib.py82510644editdlrm
threading.py29370644editdlrm
tornado.py73420644editdlrm
trytond.py17450644editdlrm
wsgi.py95810644editdlrm
_wsgi_common.py45370644editdlrm
__init__.py68270644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/sentry_sdk/integrations/modules.py (2110B)
from __future__ import absolute_import from sentry_sdk.hub import Hub from sentry_sdk.integrations import Integration from sentry_sdk.scope import add_global_event_processor from sentry_sdk._types import TYPE_CHECKING if TYPE_CHECKING: from typing import Any from typing import Dict from typing import Tuple from typing import Iterator from sentry_sdk._types import Event _installed_modules = None def _normalize_module_name(name): # type: (str) -> str return name.lower() def _generate_installed_modules(): # type: () -> Iterator[Tuple[str, str]] try: from importlib import metadata for dist in metadata.distributions(): name = dist.metadata["Name"] # `metadata` values may be `None`, see: # https://github.com/python/cpython/issues/91216 # and # https://github.com/python/importlib_metadata/issues/371 if name is not None: version = metadata.version(name) if version is not None: yield _normalize_module_name(name), version except ImportError: # < py3.8 try: import pkg_resources except ImportError: return for info in pkg_resources.working_set: yield _normalize_module_name(info.key), info.version def _get_installed_modules(): # type: () -> Dict[str, str] global _installed_modules if _installed_modules is None: _installed_modules = dict(_generate_installed_modules()) return _installed_modules class ModulesIntegration(Integration): identifier = "modules" @staticmethod def setup_once(): # type: () -> None @add_global_event_processor def processor(event, hint): # type: (Event, Any) -> Dict[str, Any] if event.get("type") == "transaction": return event if Hub.current.get_integration(ModulesIntegration) is None: return event event["modules"] = _get_installed_modules() return event