Server IP : 68.65.120.251 / Your IP : 18.222.146.86 [ Web Server : LiteSpeed System : Linux server105.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64 User : travtpib ( 6521) PHP Version : 7.4.33 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/ |
Upload File : |
from functools import wraps from typing import Any import sentry_sdk from sentry_sdk.integrations import Integration, DidNotEnable try: from UnleashClient import UnleashClient except ImportError: raise DidNotEnable("UnleashClient is not installed") class UnleashIntegration(Integration): identifier = "unleash" @staticmethod def setup_once(): # type: () -> None # Wrap and patch evaluation methods (class methods) old_is_enabled = UnleashClient.is_enabled @wraps(old_is_enabled) def sentry_is_enabled(self, feature, *args, **kwargs): # type: (UnleashClient, str, *Any, **Any) -> Any enabled = old_is_enabled(self, feature, *args, **kwargs) # We have no way of knowing what type of unleash feature this is, so we have to treat # it as a boolean / toggle feature. flags = sentry_sdk.get_current_scope().flags flags.set(feature, enabled) return enabled UnleashClient.is_enabled = sentry_is_enabled # type: ignore