JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr 0id~ddlZddlmZddlmZmZmZmZddlm Z ddl m Z ddl m Z ddlmZddlmZmZmZdd lmZmZdd lmZerdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddlm#Z#ddlm$Z$ddl%m&Z&ddl m'Z'ddlm(Z(ddl)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2ddlm3Z3e#dZ4ndZ Gdd e5Z6ed!Z7ed"Z8Gd#d$e9Z:Gd%d&e e:Z;e75e;ZZ>y#1swY!xYw)(N)contextmanager) get_clientget_global_scopeget_isolation_scopeget_current_scope)with_metaclass) INSTRUMENTER) _ScopeManager)Client)NoOpSpanSpan Transaction)logger ContextVar) TYPE_CHECKING)Any)Callable)ContextManager)Dict) Generator)List)Optional)overload)Tuple)Type)TypeVar)Union)Unpack)Scope) BaseClient) Integration)EventHint BreadcrumbBreadcrumbHintExcInfo LogLevelStrSamplingContext)TransactionKwargsTc|SN)xs =/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/hub.pyrr=sc&eZdZdZdZfdZxZS)SentryHubDeprecationWarningzR A custom deprecation warning to inform users that the Hub is deprecated. z`sentry_sdk.Hub` is deprecated and will be removed in a future major release. Please consult our 1.x to 2.x migration guide for details on how to migrate `Hub` usage to the new API: https://docs.sentry.io/platforms/python/migration/1.x-to-2.xc8t||jyr,)super__init___MESSAGE)self_ __class__s r/r5z$SentryHubDeprecationWarning.__init__Ns 'r0)__name__ __module__ __qualname____doc__r6r5 __classcell__)r9s@r/r2r2Bs  G ((r0r2c#Ktj5tjdtddddy#1swYyxYww)z>Utility function to suppress deprecation warnings for the Hub.ignore)categoryN)warningscatch_warningsfilterwarningsr2r-r0r/!_suppress_hub_deprecation_warningrESs3  "3NO  # " "sA  A A A A sentry_current_hubc,eZdZedZedZy)HubMetactjtdtj d}|7t 5t t}dddtj||S#1swY xYw)z(Returns the current instance of the hub. stacklevelN) rBwarnr2_localgetrEHub GLOBAL_HUBset)clsrvs r/currentzHubMeta.current`sX  13B ZZ  :24_5 JJrN 54s A00A9cLtjtdtS)z%Returns the main instance of the hub.rJrK)rBrMr2rQ)rSs r/mainz HubMeta.mainms  13Br0N)r:r;r<propertyrUrWr-r0r/rHrH_s(   r0rHceZdZdZdZdZerdZdZ d#dZ dZ dZ dZ dZ edZed Zd Zd Zd#d Zd#d Zd#dZd#dZej0fdZdej0dfdZd$dZe d%dZedZ d&dZdZe d%dZedZ d&dZ d'dZ dZ!dZ"dZ# d#dZ$dZ%d Z&d%d!Z'd%d"Z(y)(rPa .. deprecated:: 2.0.0 The Hub is deprecated. Its functionality will be merged into :py:class:`sentry_sdk.scope.Scope`. The hub wraps the concurrency management of the SDK. Each thread has its own hub but the hub might transfer with the flow of execution if context vars are available. If the hub is used with a with statement it's temporarily activated. Nctjtdd}t|tr=t }|Lt j}tj}n|}tj||t }t}| t}||fg|_ d|_ g|_ g|_g|_||_||_y)NrJrK)rBrMr2 isinstancerPrrforkrr set_client_stack_last_event_id _old_hubs_old_current_scopes_old_isolation_scopes_current_scope_scope)r7 client_or_hubscope current_scopeclients r/r5z Hub.__init__s  13B mS )\F}+-224 1 3 8 8 : "F   ) )& 1 =')E-/M  -/M' "#% %'"+ r0c|jjtjtj |t }|jj|tjj |jt}|jj|tjj |j|Sr,)r`appendrPrUrNrRrrarfrcrrb_isolation_scoperd)r7rgisolation_scopes r/ __enter__z Hub.__enter__s ckk* 4)+    '' 6   !4!45-/ ""))/: ""4;;/ r0cF|jj}tj||jj}t j j||jj}t jj|yr,) r`poprNrRrarfrcrbrk)r7exc_type exc_valuetboldold_current_scopeold_isolation_scopes r/__exit__z Hub.__exit__sunn  " 3 4488:   !23"88<<> ""#67r0c@|5|cdddS#1swYyxYw)z .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Runs a callback in the context of the hub. Alternatively the with statement can be used on the hub directly. Nr-r7callbacks r/runzHub.runs:TTsc4tj|S)a .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.client._Client.get_integration` instead. Returns the integration for this hub by name or class. If there is no client bound or the client does not have that integration then `None` is returned. If the return value is not `None` the hub is guaranteed to have a client attached. )rget_integration)r7 name_or_classs r/r|zHub.get_integrations"|++M::r0c<t}|jsy|S)z .. deprecated:: 2.0.0 This property is deprecated and will be removed in a future release. Please use :py:func:`sentry_sdk.api.get_client` instead. Returns the current client on the hub. N)r is_active)r7rhs r/rhz Hub.clients! r0ctS)z .. deprecated:: 2.0.0 This property is deprecated and will be removed in a future release. Returns the current scope on the hub. )rr7s r/rfz Hub.scopes #$$r0cDtjd|jS)a Returns the last event ID. .. deprecated:: 1.40.5 This function is deprecated and will be removed in a future release. The functions `capture_event`, `capture_message`, and `capture_exception` return the event ID directly. zDeprecated: last_event_id is deprecated. This will be removed in the future. The functions `capture_event`, `capture_message`, and `capture_exception` return the event ID directly.)rwarningr_rs r/ last_event_idzHub.last_event_id s$  C """r0c6tj|y)z .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.set_client` instead. Binds a new client to the hub. N)rr])r7news r/ bind_clientzHub.bind_clients %%c*r0c tj||fd|i|}|jddk(}| |s||_|S)a .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.capture_event` instead. Captures an event. Alias of :py:meth:`sentry_sdk.Scope.capture_event`. :param event: A ready-made event that can be directly sent to Sentry. :param hint: Contains metadata about the event that can be read from `before_send`, such as the original exception object or a HTTP request object. :param scope: An optional :py:class:`sentry_sdk.Scope` to apply to events. The `scope` and `scope_kwargs` parameters are mutually exclusive. :param scope_kwargs: Optional data to apply to event. For supported `**scope_kwargs` see :py:meth:`sentry_sdk.Scope.update_from_kwargs`. The `scope` and `scope_kwargs` parameters are mutually exclusive. rftype transaction)r capture_eventrOr_)r7eventhintrf scope_kwargsris_transactions r/rzHub.capture_event'sZ,:)+99 4 $ (4 6*m;  $^"/D r0c Ttj|f||d|}|||_|S)a .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.capture_message` instead. Captures a message. Alias of :py:meth:`sentry_sdk.Scope.capture_message`. :param message: The string to send as the message to Sentry. :param level: If no level is provided, the default level is `info`. :param scope: An optional :py:class:`sentry_sdk.Scope` to apply to events. The `scope` and `scope_kwargs` parameters are mutually exclusive. :param scope_kwargs: Optional data to apply to event. For supported `**scope_kwargs` see :py:meth:`sentry_sdk.Scope.update_from_kwargs`. The `scope` and `scope_kwargs` parameters are mutually exclusive. :returns: An `event_id` if the SDK decided to send the event (see :py:meth:`sentry_sdk.client._Client.capture_event`). )levelrf)rcapture_messager_)r7messagerrfrrs r/rzHub.capture_messageGsE0<)+;;    1=   $"/D r0c Rtj|fd|i|}|||_|S)a .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.capture_exception` instead. Captures an exception. Alias of :py:meth:`sentry_sdk.Scope.capture_exception`. :param error: An exception to capture. If `None`, `sys.exc_info()` will be used. :param scope: An optional :py:class:`sentry_sdk.Scope` to apply to events. The `scope` and `scope_kwargs` parameters are mutually exclusive. :param scope_kwargs: Optional data to apply to event. For supported `**scope_kwargs` see :py:meth:`sentry_sdk.Scope.update_from_kwargs`. The `scope` and `scope_kwargs` parameters are mutually exclusive. :returns: An `event_id` if the SDK decided to send the event (see :py:meth:`sentry_sdk.client._Client.capture_event`). rf)rcapture_exceptionr_)r7errorrfrrs r/rzHub.capture_exceptionhsC,>)+==   ".   $"/D r0c <tj||fi|y)a .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.add_breadcrumb` instead. Adds a breadcrumb. :param crumb: Dictionary with the data as the sentry v7/v8 protocol expects. :param hint: An optional value that can be used by `before_breadcrumb` to customize the breadcrumbs that are emitted. N)radd_breadcrumb)r7crumbrkwargss r/rzHub.add_breadcrumbs -,,UDCFCr0c >t}|jdd|i|S)aJ .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.start_span` instead. Start a span whose parent is the currently active span or transaction, if any. The return value is a :py:class:`sentry_sdk.tracing.Span` instance, typically used as a context manager to start and stop timing in a `with` block. Only spans contained in a transaction are sent to Sentry. Most integrations start a transaction at the appropriate time, for example for every incoming HTTP request. Use :py:meth:`sentry_sdk.start_transaction` to start a new transaction when one is not already in progress. For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Span`. instrumenterr-)r start_span)r7rrrfs r/rzHub.start_spans'*"#uD\DVDDr0c Jt}||d<|j|||fi|S)a .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.start_transaction` instead. Start and return a transaction. Start an existing transaction if given, otherwise create and start a new transaction with kwargs. This is the entry point to manual tracing instrumentation. A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a new child span within the transaction or any span, call the respective `.start_child()` method. Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded. When used as context managers, spans and transactions are automatically finished at the end of the `with` block. If not using context managers, call the `.finish()` method. When the transaction is finished, it will be sent to Sentry with all its finished child spans. For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Transaction`. hub)rstart_transaction)r7rrcustom_sampling_contextrrfs r/rzHub.start_transactions=H"# u &u&& '> BH  r0c<tj||||S)a  .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.continue_trace` instead. Sets the propagation context from environment or headers and returns a transaction. )environ_or_headersopnamesource)rcontinue_trace)r7rrrrs r/rzHub.continue_traces(#$331btF4  r0cyr,r-rxs r/ push_scopezHub.push_scope r0cyr,r-rxs r/rzHub.push_scoperr0cx|"|j5}||dddyt|S#1swYyxYw)a .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Pushes a new layer on the scope stack. :param callback: If provided, this method pushes a scope, calls `callback`, and pops the scope again. :returns: If no `callback` is provided, a context manager that should be used to pop the scope again. N)rr )r7ryrrfs r/rzHub.push_scopes9$  "e#T"" #s 09c`|jj}|jsJd|S)z .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Pops a scope layer from the stack. Try to use the context manager :py:meth:`push_scope` instead. z"stack must have at least one layer)r^ro)r7rTs r/pop_scope_unsafezHub.pop_scope_unsafes+[[__ {{@@@{ r0cyr,r-rxs r/configure_scopezHub.configure_scope"rr0cyr,r-rxs r/rzHub.configure_scope*rr0c~t|rj| |ytfd}|S)aK .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Reconfigures the scope. :param callback: If provided, call the callback with the current scope. :returns: If no callback is provided, returns a context manager that returns the scope. Nc3Kywr,r-rfsr/innerz"Hub.configure_scope..innerMsKs )rgenerate_propagation_contextr)r7ryrrrfs @r/rzHub.configure_scope2sI $%  .E . . 0   UO    wr0c8tj|y)z .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.start_session` instead. Starts a new session. ) session_modeN)r start_session)r7rs r/rzHub.start_sessionTs ++% , r0c4tjy)z .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.end_session` instead. Ends the current session if there is one. N)r end_sessionrs r/rzHub.end_sessionds ))+r0c4tjy)a .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.stop_auto_session_tracking` instead. Stops automatic session tracking. This temporarily session tracking for the current scope when called. To resume session tracking call `resume_auto_session_tracking`. N)rstop_auto_session_trackingrs r/rzHub.stop_auto_session_trackingos 88:r0c4tjy)a} .. deprecated:: 2.0.0 This function is deprecated and will be removed in a future release. Please use :py:meth:`sentry_sdk.Scope.resume_auto_session_tracking` instead. Resumes automatic session tracking for the current scope if disabled earlier. This requires that generally automatic session tracking is enabled. N)rresume_auto_session_trackingrs r/rz Hub.resume_auto_session_tracking}s ::D '3&9&9E4!(( $ - ^      #2      H# , ; = F$*   r0rPr)?rB contextlibr sentry_sdkrrrrsentry_sdk._compatrsentry_sdk.constsr sentry_sdk.scoper sentry_sdk.clientr sentry_sdk.tracingr r rsentry_sdk.utilsrrtypingrrrrrrrrrrrrrtyping_extensionsrrr sentry_sdk.integrationsr!sentry_sdk._typesr"r#r$r%r&r'r(r)r*DeprecationWarningr2rErNrrHrPrQrRrfr-r0r/rs % .**$  !% (&,35 A ("4(" ( )d,k  . !k  \'(J) :)(s D33D<