JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr 0i|RddlmZmZddlZddlZddlZddlZddlZddlZddl Z ddl m Z m Z m Z ddl mZddlmZ ddlZddlZddlZddlZddlmZddlmZmZmZddlmZdd lmZm Z m!Z!dd l"m#Z#m$Z$m%Z%m&Z&e#rPdd l"m'Z'dd l"m(Z(dd l"m)Z)ddl"m*Z*ddl"m+Z+ddl"m,Z,ddl"m-Z-ddl"m.Z.ddl"m/Z/ddl"m0Z0ddl1m2Z2ddl1m3Z3ddl4m5Z5m6Z6gZ7ejpddfejrddfejrddfejrddffD]%Z: e7jwe:de:de:d f'Gd!d"eZ=d.d#Z>Gd$d%e=Z?Gd&d'e?Z@ ddlAZAddlBZBGd(d)e?ZCGd+d,e=ZDd-ZEy#e$rdZYDwxYw#e<$rYwxYw#e$rGd*d)e@ZCY:wxYw)/)ABCabstractmethodN)datetime timedeltatimezone) defaultdict) getproxies) EndpointType)Dsnloggercapture_internal_exceptions)BackgroundWorker)EnvelopeItem PayloadRef) TYPE_CHECKINGcastListDict)Any)Callable) DefaultDict)Iterable)Mapping)Optional)Self)Tuple)Type)Union) PoolManager) ProxyManager)EventEventDataCategoryc"ttdS)N SO_KEEPALIVEgetattrsocketC/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/transport.pyr,0s  ?r*c"ttdS)N TCP_KEEPIDLEr&r)r*r+r,r,1s WV^eventenvelopes r+ capture_eventzTransport.capture_eventMs>  O  :5! h'r*cy)a Send an envelope to Sentry. Envelopes are a data container format that can hold any type of data submitted to Sentry. We use it to send all event data (including errors, transactions, crons check-ins, etc.) to Sentry. Nr))r>rIs r+rGzTransport.capture_envelope`s r*cy)z Wait `timeout` seconds for the current events to be sent out. The default implementation is a no-op, since this method may only be relevant to some transports. Subclasses should override this method if necessary. Nr)r>timeoutcallbacks r+flushzTransport.flushlsr*cy)z Forcefully kills the transport. The default implementation is a no-op, since this method may only be relevant to some transports. Subclasses should override this method if necessary. Nr)r>s r+killzTransport.killzsr*r-quantitycy)aThis increments a counter for event loss by reason and data category by the given positive-int quantity (default 1). If an item is provided, the data category and quantity are extracted from the item, and the values passed for data_category and quantity are ignored. When recording a lost transaction via data_category="transaction", the calling code should also record the lost spans via this method. When recording lost spans, `quantity` should be set to the number of contained spans, plus one for the transaction itself. When passing an Item containing a transaction via the `item` parameter, this method automatically records the lost spans. Nr))r>reason data_categoryitemrUs r+record_lost_eventzTransport.record_lost_events.r*cy)NTr)rRs r+ is_healthyzTransport.is_healthyr*NNN) __name__ __module__ __qualname____doc__r=r?rJrrGrPrSrZr\r)r*r+r9r9=sW J#(&         2r*r9c#tK|#tjtj}|j dD]f} |j j d}|dd\}}|t t|z}|xr|j dxsdD]}||f hy#ttf$rY{wxYww)N,:r7seconds;r^) rnowrutcsplitstriprint LookupError ValueError)headerrjlimit parametersretry_after_val categories retry_aftercategorys r+_parse_rate_limitsrxs {ll8<<(c" ,,S1J*4Ra. 'OZ #o2F GGK&@:+;+;C+@KGK ++L #Z(   s):B8A#B# B8#B52B84B55B8ceZdZdZdZdZ ddddZdZd Ze jdfd Z d Z dd Z d d ZdZdZdZdZdZdZdZdZdZdZdZ d!dZdZedZedZej@dZy)"BaseHttpTransportzThe base HTTP transport.cddlm}tj|||jJ||_t |d|_|jjd|z|_ i|_ tjj|_tt |_t%j$|_|j)|_t,j.|_|j3di}|j3d|j3d}|j3d |t4d nd }|d k(rt4t7j8d d }d}|d vr%t7j8d|d|_d|_n||_|||_y|j<d k(rd|_y|j<d k(rd|_yy)Nr)VERSIONtransport_queue_size) queue_sizezsentry.python/%s _experimentstransport_compression_level transport_zlib_compression_leveltransport_compression_algogzipbrzSYou asked for brotli compression without the Brotli module, falling back to gzip -9)rrz2Unknown compression algo %s, disabling compression )sentry_sdk.constsr}r9r?r=r<r_workerto_auth_auth_disabled_untilurllib3utilRetry_retryrrn_discarded_eventstime_last_client_report_sent _make_pool_pool sentry_sdkHub_hub_clsgetbrotlir warning_compression_level_compression_algo)r>r<r} experimentscompression_levelcompression_algos r+r?zBaseHttpTransport.__init__s-4)*** '7;Q3RS __,,-?'-IJ !ll((* !,S!1(, %__& # kk."5 'OO ) OO> ? '?? ( %0FN   t # NNe  &  $  > 1 NNDFV '(D #%)D "%5D "  (&7D #  # #v -&'D #  # #t +&'D #,r*Nr-rTc|jdsy||j}d}|dk(rl|jxsi}tt t t ttf|jdxsgdz}|j|d|n0|dk(r+t|jxsd}n | td|j||fxx|z cc<y) Nsend_client_reportsr- transactionspansspanrT attachmentzdata category not provided)r<rXget_transaction_eventlenrrrstrobjectrrZ get_bytes TypeErrorr)r>rWrXrYrUrH span_counts r+rZz#BaseHttpTransport.record_lost_events||12    ..MH -224:T$sF{"34eii6H6NBOPSTT&&vv &K,.t~~/05A  "89 9 }f45A5r*c8|jj|Sr^)headersrr>responserqs r+_get_header_valuez#BaseHttpTransport._get_header_values##F++r*c|j|d}|r:tjd|jj t |y|j dk(rtjd|j|d}||jj|ndxsd}tjtjt|z|jd<yy)Nzx-sentry-rate-limitsz%Rate-limited via x-sentry-rate-limitszRate-limited via 429z Retry-After<rg)rr rrupdaterxstatusrparse_retry_afterrrjrrkr)r>rrqretry_after_valuervs r+_update_rate_limitsz%BaseHttpTransport._update_rate_limitss ''2HI  NNB C  ' '(:6(B C __ # NN1 2 $ 6 6x O %0 --.?@  *2hll)Ci#G*D  &$r*c fd}|jtjjtjj d j d|||} j||jdk(rjdn|jdk\s|jd kritjd |jt|d t|d djd j|j|d|jy#t $rjd|dwxYw#|jwxYw)Nczj|dyjD]}j||y)Nerror)rXrY)rZitems)rWrYrIr>s r+ record_lossz4BaseHttpTransport._send_request..record_loss=s=&&vW&E$NND**6*=+r*)z User-Agentz X-Sentry-AuthPOSTnetwork network_errorr status_429i,z%Unexpected status code: %s (body: %s)datacontentz status_{})rrrclient to_header_request Exceptionon_dropped_eventrrr rr'formatclose)r>bodyr endpoint_typerIrrs` ` r+ _send_requestzBaseHttpTransport._send_request4s= > !$**"3"34!$TZZ%9%9%;!<  }} H   $ $X .#% %%l3C'8??S+@ ;OOHfgh 4.PQ %%k&8&8&IJO, NN 3   ! !) ,  (  2 NN sD;1B9E";$E"E4cyr^r))r>_reasons r+rz"BaseHttpTransport.on_dropped_eventmr]r*c|jdsy|s%|jtj|z ksy|j}t t |_tj|_|syt ttj|jDcgc]\\}}}|||dc}}}ddScc}}}w)Nr)rWrwrU) timestampdiscarded_events)json client_report)type) r<rrrrrnrrr)r>forceintervalrrwrWrUs r+_fetch_pending_client_reportz.BaseHttpTransport._fetch_pending_client_reportqs||1266x9OO11!,S!1(, % !% .335 ) 6.Xv$$*xXV6 )  !  )s%C ch|j|d}||jt|gyy)Nr)rr)r)rrGr)r>rrs r+_flush_client_reportsz'BaseHttpTransport._flush_client_reportss899PR9S  $  ! !(-"A B %r*c2fd}||xs|dS)Ncjj|}|duxr&|tjtj kDSr^)rrrrjrrk)buckettsr>s r+ _disabledz4BaseHttpTransport._check_disabled.._disableds:%%))&1BT>Eb8<< +E&E Er*r))r>rwrs` r+_check_disabledz!BaseHttpTransport._check_disableds F "5io5r*cVtd|jjDS)Nc3hK|]*}|tjtjkD,ywr^)rrjrrk).0rs r+ z5BaseHttpTransport._is_rate_limited..s' 6SBhll+ +6Ss02)anyrvaluesrRs r+_is_rate_limitedz"BaseHttpTransport._is_rate_limiteds+ 6:6J6J6Q6Q6S   r*c6|jjSr^)rfullrRs r+_is_worker_fullz!BaseHttpTransport._is_worker_fulls||  ""r*cH|jxs|j Sr^)rrrRs r+r\zBaseHttpTransport.is_healthys"((*Ed.C.C.EFFr*cg}|jD]a}|j|jr3|jdvr|jd|j d|Q|j |ct |j|}|jsy|jd}||jj ||j|\}}|jJtjd|j|jj|jjd d i}|r||d <|j!|j#|t$j&| y) N)rrdefaultstatsdself_rate_limitsratelimit_backoffr)rrr{)rz(Sending envelope [%s] project:%s host:%sz Content-Typezapplication/x-sentry-envelopezContent-Encoding)rrrI)rrrXrrZappendrrr_serialize_enveloper=r debug description project_idhostrgetvaluer ENVELOPE)r>rI new_itemsrYclient_report_itemcontent_encodingrrs r+_send_envelopez BaseHttpTransport._send_envelopes_ NND##D$6$67%%)VV))*<=&&':&F  & #H$4$4IF~~">>>K  ) NN ! !"4 5!%!9!9(!C$*** 6  OO & & OO   ;  *:G& '  MMO&//  r*cd}tj}|jdk(s |j|j |||fS|j}|jdk(rHt B|j t j|j|j||fStj|d|j5}|j |ddd||fS#1swY||fSxYw)Nrr)qualityw)fileobjmode compresslevel) ioBytesIOrrserialize_intorwritecompress serializerGzipFile)r>rIrrfs r+rz%BaseHttpTransport._serialize_envelopeszz|  " "a '4+A+A+I  # #D ) %% $55 %%-&2D OO **,d6M6M %% ]] s$:Q:Q++A.  %%   %%s C**C6ctr^NotImplementedErrorrRs r+_get_pool_optionsz#BaseHttpTransport._get_pool_options !##r*ctjd}|sy|jdD]J}|j}|jj |s|j j |sJyy)NnoFreT)r rrlrmrendswithnetloc)r>r=no_proxyrs r+ _in_no_proxyzBaseHttpTransport._in_no_proxyse<##D)NN3'D::methodrrrs r+rzBaseHttpTransport._request s "##r*cfd}jj|s6jdjD]}j d|yy)Nct5jjdddy#1swYyxYwr^)r rr)rIr>sr+send_envelope_wrapperzABaseHttpTransport.capture_envelope..send_envelope_wrappers/,.##H-**,/..s "7A full_queuequeue_overflowr)rsubmitrrrZ)r>rIr rYs`` r+rGz"BaseHttpTransport.capture_envelopesR  - ||""#89  ! !, / &&'7d&C':r*ctjd|dkDr;jjfdjj ||yy)NzFlushing HTTP transportrc(jdS)NT)r)rrRsr+r,z)BaseHttpTransport.flush...s(B(B(B(Nr*)r rrr#rPrMs` r+rPzBaseHttpTransport.flush%sE  ./ Q; LL   N O LL  w 1 r*cbtjd|jjy)NzKilling HTTP transport)r rrrSrRs r+rSzBaseHttpTransport.kill1s -. r*c<tjdtdy)zRConvenience method to warn users about the deprecation of the `hub_cls` attribute.zNThe `hub_cls` attribute is deprecated and will be removed in a future release.rAN)rCrDrEr)r*r+ _warn_hub_clszBaseHttpTransport._warn_hub_cls6s  \  r*cBtj|jS)QDEPRECATED: This attribute is deprecated and will be removed in a future release. HttpTransportr)rrRs r+hub_clszBaseHttpTransport.hub_cls@s ##%}}r*c:tj||_y)r+Nr,)r>values r+r.zBaseHttpTransport.hub_clsGs ##% r*r_)Fr)Fr^)!r`rarbrcTIMEOUTr?rZrrr rrrrrrrrr\rrrrrrrGrPrS staticmethodr)propertyr.setterr)r*r+rzrzs"G9(|  "B  "BH,:#++ 7r >C 6 #G3j&,$ $$D& 2     ^^r*rzc8eZdZUer eeefed<dZdZ dZ y)r-rc\|jjdijd}|dn t|dtj|j d}d}|jd|jd}|jdrD|g}|Dchc] }|d |d f}}t D] }|d |d f|vs|j|"|||d<|jd xsVtjjd xs5tjjd xstj|d <|jdxstjjd|d<|jdxstjjd|d<|Scc}w)Nrtransport_num_poolsr7 CERT_REQUIRED)total) num_pools cert_reqsrNsocket_options keep_aliverr-ca_certs SSL_CERT_FILEREQUESTS_CA_BUNDLE cert_fileCLIENT_CERT_FILEkey_fileCLIENT_KEY_FILE) r<rrnrTimeoutr1KEEP_ALIVE_SOCKET_OPTIONSrosenvironcertifiwhere)r>r:r<r<o used_optionsdefault_options r+rzHttpTransport._get_pool_optionsSsLL$$^R8<<=RS '/S^(T\\:   <<( ) 5!\\*:;N << %%!#2@A.QQqT1Q4L.LA";"1%~a'89M")).9#<  %(6G$ % LL $ zz~~o. zz~~23 }}   $||K8 BJJNN =  #ll:6 "**.. ;  -BsF)c|j tdd}|j|j}|jd}|jjdk(r'|dk7r"|xs| xrt j d}|jd}|s'|dk7r"|xs| xrt j d}|j}|rf|jd}|r||d<|jdr)d } d d l m }|r |fi|Stjdi|Stj |fi|Stjdi|S#t$rd }tjd |YnwxYw)N4Cannot create HTTP-based transport without valid DSN https_proxyhttps http_proxyhttp proxy_headerssocksTr)SOCKSProxyManagerFzYou have configured a SOCKS proxy (%s) but support for SOCKS proxies is not installed. Disabling proxy support. Please add `PySocks` (or `urllib3` with the `[socks]` extra) to your dependencies.r))r=rprr<schemer rr startswithurllib3.contrib.socksrW ImportErrorr rrr r!) r>proxyrrPrSoptsrUuse_socks_proxyrWs r+rzHttpTransport._make_pool~su ?? "ST T$$T__5ll=1 ?? ! !W ,+2COL$NZ\5E5Eg5NE\\,/ **Mx<#LJL4D4DV4LE%%'  LL9M(5_%("&G#,U;d;;"..666++E:T::&&.. .#&+ONN]s8E !E-,E-cr|jj||jj|||S)N)rr)rrequestr get_api_urlrs r+rzHttpTransport._requests;zz!!  JJ " "= 1 "  r*N) r`rarbrrr r!__annotations__rrrr)r*r+r-r-Os&[,.//)V,/\  r*r-ceZdZUdZdZer)eejejejfe d<dZ dZ dZdZy) Http2Transportz&The HTTP2 transport based on httpcore.rcBtfd|jDdS)Nc3K|]:\}}|jdjk(r|jd<yw)asciiN)decodelower)rkeyvalrqs r+rz3Http2Transport._get_header_value..s@$4Szz'*002f<JJw'$4sAA)nextrrs `r+rz Http2Transport._get_header_values($,$4$4   r*c |jj||jj|||d|j|j|j|jdi}|S)NrN)poolconnectr read)rr extensions)rr`rrar1)r>rrrrrs r+rzHttp2Transport._requestshzz)) &&}5 $ #'<r?r@rArBrCrD ssl_context)r=rXr<rFrsslcreate_default_contextload_verify_locationsrGrHrrIrJload_cert_chain) r>r<r<rKrLrMrvrArCs r+rz Http2Transport._get_pool_optionss46OO**g5G<< 01= -.  3AA.QQqT1Q4L.LA";"1%~a'89M")).9#<)7G$ %446K  - - Z(#::>>/2#::>>"67#==?    [1WRZZ^^DV5WI||J/T2::>>BS3TH$++Ix@%0GM "N+BsFc|j tdd}|j|j}|jd}|jjdk(r'|dk7r"|xs| xrt j d}|jd}|s'|dk7r"|xs| xrt j d}|j}|r|jd}|r||d<|jdrD d |vr(|jd }|rtjd tjd d |i|Stjd d |i|Stj d i|S#t$rtjd |Y6wxYw)NrOrPrQrRrSrTrUrVr<zqYou have defined socket_options but using a SOCKS proxy which doesn't support these. We'll ignore socket_options. proxy_urlzoYou have configured a SOCKS proxy (%s) but support for SOCKS proxies is not installed. Disabling proxy support.r))r=rprr<rXr rrrYpopr rhttpcore SOCKSProxy RuntimeError HTTPProxyConnectionPool)r>r\rrPrSr]rUr<s r+rzHttp2Transport._make_pools& !WXXE((9H,,}5K%%0kR6G#SH (R9I9I'9Rl3JjB."Q8|'P 8H8H8P))+D $ _ =  ,9D)##G, +t3-1XX6F-GN- &%X!" (22KUKdKK$--FFFF**2T2 2(N!s6AE%%FFN)r`rarbrcr1rrr~rrrrbrrrrr)r*r+rdrdsK4 ##X%7%79P9PP   0# J) 3r*rdceZdZfdZxZS)rdcNt||tjdy)NzhYou tried to use HTTP2Transport but don't have httpcore[http2] installed. Falling back to HTTPTransport.)superr?r r)r>r< __class__s r+r?zHttp2Transport.__init__s G W % NNz r*)r`rarbr? __classcell__)rs@r+rdrds   r*c,eZdZdZdZdZdeddfdZy)_FunctionTransportz DEPRECATED: Users wishing to provide a custom transport should subclass the Transport class, rather than providing a function. c<tj|||_yr^)r9r?_func)r>funcs r+r?z_FunctionTransport.__init__Os 4  r*c&|j|yr^)r)r>rHs r+rJz _FunctionTransport.capture_eventWs 5r*rIreturnNcL|j}||j|yyr^) get_eventrJ)r>rIrHs r+rGz#_FunctionTransport.capture_envelope_s+""$     u % r*)r`rarbrcr?rJrrGr)r*r+rrIs$ &&d&r*rcV|d}|jdijdd}|rtnt}t|tr|St|t rt |tr|}n2t|r'tjdtdt|S|dr||Sy) N transportrtransport_http2FzFunction transports are deprecated and will be removed in a future release.Please provide a Transport instance or subclass, instead.r7rAr;) rrdr- isinstancer9r issubclasscallablerCrDrEr)r< ref_transportuse_http2_transport transport_clss r+make_transportrhsK(M!++nb9==>OQVW':N}M-+ M4 (Z y-Q% -   H   "-00u~W%% r*r^)FabcrrrrGrr(rwrrCrrr collectionsrurllib.requestr rr[rrIrrr sentry_sdk.utilsr r r sentry_sdk.workerrsentry_sdk.enveloperrrtypingrrrrrrrrrrrrrrurllib3.poolmanagerr r!sentry_sdk._typesr"r#rF SOL_SOCKETSOL_TCPoptionrAttributeErrorr9rxrzr-r~h2rdrrr)r*r+rs# 22#%*EE.::22"/0: ?C ^^s FP    Ps5E:"FF:FFFFF&%F&