📁 File Manager Pro
v10.0.3 | PHP: 8.2.31
Server: LiteSpeed
2026-06-28 02:00:22
📂
/ (Root)
/
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
/
integrations
/
__pycache__
📍 /opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/__pycache__
🔄 Refresh
✏️
Editing: rust_tracing.cpython-312.pyc
Read Only
� |�*j�% � �* � d Z ddlZddlmZmZ ddlmZmZmZm Z m Z ddlZddlm Z ddlmZ ddlmZ ddlmZ dd lmZ dd lmZ G d� de� Z G d � de� Zdeddfd�Zdd�Zd d�Zd d�Zd d�Z ddde!fd�Z"d!d�Z# G d� d� Z$ G d� de � Z%y)"ae This integration ingests tracing data from native extensions written in Rust. Using it requires additional setup on the Rust side to accept a `RustTracingLayer` Python object and register it with the `tracing-subscriber` using an adapter from the `pyo3-python-tracing-subscriber` crate. For example: ```rust #[pyfunction] pub fn initialize_tracing(py_impl: Bound<'_, PyAny>) { tracing_subscriber::registry() .with(pyo3_python_tracing_subscriber::PythonCallbackLayerBridge::new(py_impl)) .init(); } ``` Usage in Python would then look like: ``` sentry_sdk.init( dsn=sentry_dsn, integrations=[ RustTracingIntegration( "demo_rust_extension", demo_rust_extension.initialize_tracing, event_type_mapping=event_type_mapping, ) ], ) ``` Each native extension requires its own integration. � N)�Enum�auto)�Any�Callable�Dict�Optional�Union)�Integration)�should_send_default_pii)�StreamedSpan)�Span)�has_span_streaming_enabled)�SENSITIVE_DATA_SUBSTITUTEc � � e Zd ZdZdZdZdZdZy)�RustTracingLevel�TRACE�DEBUG�INFO�WARN�ERRORN)�__name__� __module__�__qualname__�Trace�Debug�Info�Warn�Error� � �S/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/rust_tracing.pyr r . s � ��E��E��D��D��Er r c �D � e Zd Z e� Z e� Z e� Z e� Zy)�EventTypeMappingN)r r r r �Ignore�Exc� Breadcrumb�Eventr r r! r# r# 6 s � � �V�F� �&�C���J��F�Er r# �level�returnzsentry_sdk._types.LogLevelStrc �� � t | � } | t j t j fv ry| t j k( ry| t j k( ry| t j k( ryy)N�debug�info�warning�error)r r r r r r )r( s r! �tracing_level_to_sentry_levelr/ = se � ��U�#�E��!�'�'�)9�)?�)?�@�@�� �"�'�'� '�� �"�'�'� '�� �"�(�(� (�� r �Dict[str, Any]c � � | j di � }i }i }dD ] }||v s�|| ||<