
    fi1                        d dl mZmZ d dlmZ d dlmZ d dlmZ er<d dl	m
Z
 d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ  e edd                    Z e            Z e            Z e            Zd Zg dZg dZ eee          Z[i ddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5i d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdOdUd?dVdWdXdYdZdd[d\d]d^d_d`daZdBdNdhiZ 	 	 	 	 dkdeZ!dldfZ" G dg dhe#          Z$ G di dje          Z%ddS )m    )ABCabstractmethod)Lock)logger)TYPE_CHECKING)Sequence)Callable)Dict)Iterator)List)Optional)Set)Type)Union)Anyi  iX  c                       fd}t          |j        t                    r( D ]%}|xj        d                    |          z  c_        &|S )Nc              3     K   ddl m} | rz   }n}|D ]k}	 |                    dd          \  }}t           ||          |          V  8# t          t
          f$ r }t          j        d||           Y d}~dd}~ww xY wdS )z7Returns an iterator of the default integration classes:r   )import_module.   z)Did not import default integration %s: %sN)	importlibr   rsplitgetattrDidNotEnableSyntaxErrorr   debug)	with_auto_enabling_integrationsr   all_import_stringsimport_stringmoduleclseauto_enabling_integrationsintegrationss	          p/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/sentry_sdk/integrations/__init__.pyiter_default_integrationszJ_generate_default_integrations_iterator.<locals>.iter_default_integrations'   s       	,+++++* 	.!-0J!J!-/ 	 	M+223::mmF33S999999 +.   ?PQ       		 	s   4AA?A::A?z
- `{}`)
isinstance__doc__strformat)r$   r#   r&   r   s   ``  r%   '_generate_default_integrations_iteratorr+   !   sw         & +3S99 R) 	R 	RM%--1B1B=1Q1QQ---$$    )z,sentry_sdk.integrations.argv.ArgvIntegrationz0sentry_sdk.integrations.atexit.AtexitIntegrationz0sentry_sdk.integrations.dedupe.DedupeIntegrationz8sentry_sdk.integrations.excepthook.ExcepthookIntegrationz2sentry_sdk.integrations.logging.LoggingIntegrationz2sentry_sdk.integrations.modules.ModulesIntegrationz0sentry_sdk.integrations.stdlib.StdlibIntegrationz6sentry_sdk.integrations.threading.ThreadingIntegration)'z2sentry_sdk.integrations.aiohttp.AioHttpIntegrationz6sentry_sdk.integrations.anthropic.AnthropicIntegrationz2sentry_sdk.integrations.ariadne.AriadneIntegrationz*sentry_sdk.integrations.arq.ArqIntegrationz2sentry_sdk.integrations.asyncpg.AsyncPGIntegrationz.sentry_sdk.integrations.boto3.Boto3Integrationz0sentry_sdk.integrations.bottle.BottleIntegrationz0sentry_sdk.integrations.celery.CeleryIntegrationz2sentry_sdk.integrations.chalice.ChaliceIntegrationzEsentry_sdk.integrations.clickhouse_driver.ClickhouseDriverIntegrationz0sentry_sdk.integrations.cohere.CohereIntegrationz0sentry_sdk.integrations.django.DjangoIntegrationz0sentry_sdk.integrations.falcon.FalconIntegrationz2sentry_sdk.integrations.fastapi.FastApiIntegrationz.sentry_sdk.integrations.flask.FlaskIntegrationz*sentry_sdk.integrations.gql.GQLIntegrationz4sentry_sdk.integrations.graphene.GrapheneIntegrationz.sentry_sdk.integrations.httpx.HttpxIntegrationz,sentry_sdk.integrations.huey.HueyIntegrationzAsentry_sdk.integrations.huggingface_hub.HuggingfaceHubIntegrationz6sentry_sdk.integrations.langchain.LangchainIntegrationz6sentry_sdk.integrations.langgraph.LanggraphIntegrationz4sentry_sdk.integrations.litestar.LitestarIntegrationz0sentry_sdk.integrations.loguru.LoguruIntegrationz*sentry_sdk.integrations.mcp.MCPIntegrationz0sentry_sdk.integrations.openai.OpenAIIntegrationz=sentry_sdk.integrations.openai_agents.OpenAIAgentsIntegrationz9sentry_sdk.integrations.pydantic_ai.PydanticAIIntegrationz2sentry_sdk.integrations.pymongo.PyMongoIntegrationz2sentry_sdk.integrations.pyramid.PyramidIntegrationz.sentry_sdk.integrations.quart.QuartIntegrationz.sentry_sdk.integrations.redis.RedisIntegrationz(sentry_sdk.integrations.rq.RqIntegrationz.sentry_sdk.integrations.sanic.SanicIntegrationz8sentry_sdk.integrations.sqlalchemy.SqlalchemyIntegrationz6sentry_sdk.integrations.starlette.StarletteIntegrationz4sentry_sdk.integrations.starlite.StarliteIntegrationz8sentry_sdk.integrations.strawberry.StrawberryIntegrationz2sentry_sdk.integrations.tornado.TornadoIntegration)r$   r#   aiohttp)      	anthropic)r      ariadne)r      arq)r      asyncpgbeam)      boto3)r   r9   bottle)r   r9   celery)r/   r/      chalice)r   r1   r   clickhouse_driver)r   r8   r   cohere)   r/   r   django)r      dramatiq)r   	   falcon)r   r/   fastapi)r   O   r   flask)r   r   r/   gql)r.   r/   r   graphene)r.   r.   google_genai)r      r   grpc)r       r   httpx)r   r1   r   huggingface_hub)r      r=   	langchain)r   r   r   	langgraph)r      rU   launchdarkly)rE   rC   r   litellm)r   M   rA   loguru)r   r=   r   mcp)r      r   openai)r   r   r   openai_agents)r   r      openfeature)r   r=   r   pydantic_aiquart)r8   r=   r   )r8   r   r   )r   rU   )r   rC   )r   r8   )r   0   )r   7   r.   )r      rA   )rU   r   )r   r[   )rU   r   r   )rayrequestsrqsanic
sqlalchemy	starlettestarlitestatsig
strawberrytornadotyperunleashTFNc                 2   t          d | pdD                       } t          j        d|           t          |                                           }d |pg D             }t                      }|rIt          |          D ]9}|j        | vr. |            }|| |j        <   |                    |j                   :d |D             }	t          	                                D ]b\  }
}|
| v rY|
|	vrU|D ]R}||vrLt          d          D ]<}|j        |k    r/||vr+|
                    |           t          j        d||
           =Sc| 	                                D ]\  }}
t          5  |t          vrt          |
          |v rt          j        d|           nt          j        d	|           	 t          |
                                           |
                    |           t                               |           n2# t"          $ r%}||vr t          j        d
||           Y d}~nd}~ww xY wt                              |           ddd           n# 1 swxY w Y   
d | 	                                D             } | D ]}t          j        d|           | S )a)  
    Given a list of integration instances, this installs them all.

    When `with_defaults` is set to `True` all default integrations are added
    unless they were already provided before.

    `disabled_integrations` takes precedence over `with_defaults` and
    `with_auto_enabling_integrations`.

    Some integrations are designed to automatically deactivate other integrations
    in order to avoid conflicts and prevent duplicate telemetry from being collected.
    For example, enabling the `langchain` integration will auto-deactivate both the
    `openai` and `anthropic` integrations.

    Users can override this behavior by:
      - Explicitly providing an integration in the `integrations=[]` list, or
      - Disabling the higher-level integration via the `disabled_integrations` option.
    c              3   (   K   | ]}|j         |fV  d S N
identifier.0integrations     r%   	<genexpr>z%setup_integrations.<locals>.<genexpr>   s;        2=	-     r,    z+Setting up integrations (with default = %s)c                 Z    g | ](}t          |t                    r|nt          |          )S rz   )r'   typerv   s     r%   
<listcomp>z&setup_integrations.<locals>.<listcomp>   sC        "+t44K${:K:K  r,   c                     h | ]	}|j         
S rz   rt   rv   s     r%   	<setcomp>z%setup_integrations.<locals>.<setcomp>   s(     ( ( (#.( ( (r,   TzAAuto-deactivating %s integration because %s integration is activezIgnoring integration %sz0Setting up previously not enabled integration %sz)Did not enable default integration %s: %sNc                 ,    i | ]\  }}|t           v ||S rz   )_installed_integrations)rw   ru   rx   s      r%   
<dictcomp>z&setup_integrations.<locals>.<dictcomp>  s4       #J000 	K000r,   zEnabling integration %s)dictr   r   setkeysr&   ru   add_INTEGRATION_DEACTIVATESitemsappend_installer_lock_processed_integrationsr|   
setup_oncesetup_once_with_optionsr   r   )r$   with_defaultsr   disabled_integrationsoptionsuser_provided_integrationsused_as_default_integrationintegration_clsinstance disabled_integration_identifiersrx   targets_to_deactivatetargetr!   ru   r"   s                   r%   setup_integrationsr      s   4   AMASQS    L L>NNN!$\%6%6%8%8!9!9 06B   #&%% E8+ 
  
 	E 	EO )==*?,,4<X01+//0CDDD( (2G( ( ($ /G.L.L.N.N " "**<''#CCC/ 
" 
"!;;;8>> " ">V33"*??? 5 < <S A A A &$g$*$/!" !" !" $0#5#5#7#7 8 8
K 	8 	8!888$$(===L!:JGGGGLJJ  @[))44666#;;GDDD 033J???? (   %-HHH!GUV       	 (++J777+	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8. '3'9'9';';  L # < <
.
;;;;s=   "AI)6G:I:
H)H$I$H))II	I	c                    |p| j         }|t          d| d          t                              | j                   }|d S ||k     r<t          d| dd                    t          t          |                     d          d S )NzUnparsable z	 version.zIntegration only supports  r   z
 or newer.)ru   r   _MIN_VERSIONSgetjoinmapr)   )rx   versionpackagemin_versions       r%   _check_minimum_versionr   #  s    //G;;;;<<<##K$:;;K^^^388C[<Q<Q3R3R^^^
 
 	
 r,   c                       e Zd ZdZdS )r   a  
    The integration could not be enabled due to a trivial user error like
    `flask` not being installed for the `FlaskIntegration`.

    This exception is silently swallowed for default integrations, but reraised
    for explicitly enabled integrations.
    N)__name__
__module____qualname__r(   rz   r,   r%   r   r   4  s           r,   r   c                   L    e Zd ZdZdZ	 dZ	 eed                         ZddZ	dS )IntegrationzBaseclass for all integrations.

    To accept options for an integration, implement your own constructor that
    saves those options on `self`.
    Nc                      dS )a`  
        Initialize the integration.

        This function is only called once, ever. Configuration is not available
        at this point, so the only thing to do here is to hook into exception
        handlers, and perhaps do monkeypatches.

        Inside those hooks `Integration.current` can be used to access the
        instance again.
        Nrz   rz   r,   r%   r   zIntegration.setup_onceK  s	     	r,   c                     dS )z
        Called after setup_once in rare cases on the instance and with options since we don't have those available above.
        Nrz   )selfr   s     r%   r   z#Integration.setup_once_with_options[  s	    
 	r,   rs   )
r   r   r   r(   installru   staticmethodr   r   r   rz   r,   r%   r   r   >  sg          G*J.  ^ \     r,   r   )TFNNrs   )&abcr   r   	threadingr   sentry_sdk.utilsr   typingr   collections.abcr   r	   r
   r   r   r   r   r   r   r   	frozensetrange$_DEFAULT_FAILED_REQUEST_STATUS_CODESr   r   r   r   r+   _DEFAULT_INTEGRATIONS_AUTO_ENABLING_INTEGRATIONSr&   r   r   r   r   	Exceptionr   r   rz   r,   r%   <module>r      s?   # # # # # # # #       # # # # # #             
(((((( (1ysC'A'A $ $&& #%%  #%% % % %@
 
 
 ( ( ( T DC&:   
 ,/v// w/ 
7	/
 w/ G/ W/ g/ i/ z/ / i/ f/ / f/  z!/" Y#/ /$ 
9%/& '/( J)/* J+/, Z-/. z//0 1/2 3/4 I5/6 z7/8 i9/: 
:;/< i=/> Z?/@ 9A/B 9C/D ZE/ /F 
]/ / /f (K(  $)j j j jZ
 
 
 
"    9   " " " " "# " " " " "r,   