ó
    Ð]j^ ã                  óö  • % S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
r
S SKrS SKrS SKJr  S SKJr  S SKJrJr  S SKJr  S SKJr  S SKJrJr  S S	KJrJrJrJrJrJ r   S S
K!J"r"  S SK#J$r$  S SK%r%S SK&J'r'  S SK(J)r)J*r*  S SK+J,r,J-r-J.r.  S SK/J0r0  S SK1J2r2  S SK3J4r4  S SK5J6r6  S SK7J8r8J9r9  S SK:J;r;J<r<  S SK=J>r?J@r@  S SKAJBrB  S SKCJDrDJErE  S SKFJGrGJHrHJIrIJJrJJKrK  S SKLJMrMJNrNJOrOJPrPJQrQJRrRJSrS  S SKTJUrUJVrVJWrW  S SKXJYrYJZrZJ[r[  S SK\J]r]  S SK^J_r_J`r`Jarb  S SKcJdrdJere  S SKfJgrg  S S KhJiriJjrj  S S!KkJlrl  S S"KmJnrnJoro  S S#KpJqrqJrrrJsrs  S S$KtJuruJvrv  S S%KwJxrx  S S&KyJzrz  S S'K{J|r|  S S(K}J~r~  S S)KJ€r€J�r�  S S*K‚Jƒrƒ  S+S,K„J…r…J†r†  S+S-K‡Jˆrˆ  S.S/K‰JŠrŠJ‹r‹JŒrŒ  S.S0K�JŽrŽJ�r�J�r�  S.S1K‘J’r’J“r“J”r”J•r•J–r–J—r—J˜r˜  S.S2K™JšršJ›r›JœrœJ�r�Jžrž  S.S3KŸJ r   S.S4K¡J¢r¢J£r£  S.S5K¤J¥r¥J¦r¦J§r§J¨r¨J©r©  S.S6KªJ«r«J¬r¬  S.S7K­J®r®  S.S8K¯J°r°  S.S9K±J²r²  S.S:K³J´r´  S.S;KµJ¶r¶  S.S<K·J¸r¸  S.S=K¹JºrºJ»r»J¼r¼J½r½  S.S>K¾J¿r¿  S.S?KÀJÁrÁJÂrÂJÃrÃ  S.S@KÄJÅrÅJÆrÆJÇrÇJÈrÈJÉrÉ  \(       a  S SAKJÊrÊ  S SBKËJÌrÌ  S.SCKÍJÎrÎ  SDrÏ SESF\ƒ 30rÐ SGrÑ\M\UGR¤                  \S\UGR¦                  \N\UGR¤                  \P\UGR¤                  \R\UGR¦                  \Q\UGR¦                  0rÔ \ " SH SI5      5       rÕ\ " SJ SK5      5       rÖ\ " SL SM5      5       r×\ " SN SO5      5       rØ\ " SP SQ5      5       rÙ\ " SR SS5      5       rÚ\ " ST SU5      5       rÛ " SV SW\ 5      rÜSXSSSSSSSSSSSSSSSSYSSSSSZ.                                             SoS[ jjrÝ\R"                   " S\ S]5      5       rÞ " S^ S_\Þ5      rß/ ràS`\áSa'   \GRÄ                  Sb 5       rã\GRÈ                  råSpSc jræ\æ\lä        \ß" 5       rç\R"                   " Sd Se5      5       rèSqSf jréSrSg jrêSsSh jrëStSi jrìSuSj jríSk rîStSl jrï " Sm Sn\ð5      rñg)vé    )ÚannotationsN)ÚSequence)Úsuppress)Ú	dataclassÚfield)Ú	timedelta)ÚPath)ÚRLockÚThread)ÚTYPE_CHECKINGÚAnyÚCallableÚClassVarÚLiteralÚ	TypedDict)Úurljoin)Úuuid4)Útrace)ÚNoOpLoggerProviderÚset_logger_provider)ÚOTEL_LOGS_EXPORTERÚOTEL_METRICS_EXPORTERÚOTEL_TRACES_EXPORTER)ÚCompression)ÚOTLPLogExporter)ÚOTLPMetricExporter)ÚOTLPSpanExporter)ÚNoOpMeterProviderÚset_meter_provider)Úget_global_textmapÚset_global_textmap)ÚLoggerProviderÚLogRecordProcessor)Ú"SynchronousMultiLogRecordProcessor)ÚBatchLogRecordProcessorÚSimpleLogRecordProcessor)ÚOTEL_EXPORTER_OTLP_ENDPOINTÚ OTEL_EXPORTER_OTLP_LOGS_ENDPOINTÚ#OTEL_EXPORTER_OTLP_METRICS_ENDPOINTÚ"OTEL_EXPORTER_OTLP_TRACES_ENDPOINTÚOTEL_RESOURCE_ATTRIBUTES)ÚCounterÚ	HistogramÚMeterProviderÚObservableCounterÚObservableGaugeÚObservableUpDownCounterÚUpDownCounter)ÚAggregationTemporalityÚMetricReaderÚPeriodicExportingMetricReader)ÚDropAggregationÚ%ExponentialBucketHistogramAggregationÚView)ÚResource)ÚSpanProcessorÚSynchronousMultiSpanProcessorÚTracerProvider)ÚBatchSpanProcessorÚSimpleSpanProcessor)ÚIdGenerator)ÚParentBasedTraceIdRatioÚSampler©ÚConsole)ÚConfirmÚPrompt)ÚSelfÚUnpackÚassert_type)ÚPYDANTIC_LOGFIRE_TOKEN_PATTERNÚREGIONS)Ú$DirectBaggageAttributesSpanProcessor)ÚLogfireConfigError)ÚSamplingOptions)ÚTailSamplingProcessor)ÚNoOpVariableProviderÚVariableProvider)ÚVERSIONé   )ÚNoExtractTraceContextPropagatorÚ#WarnOnExtractTraceContextPropagator)ÚExceptionCallbacké   )ÚInvalidProjectNameÚLogfireClientÚProjectAlreadyExists)ÚParamManagerÚPydanticPluginRecordValuesÚnormalize_token)ÚLEVEL_NUMBERSÚ"RESOURCE_ATTRIBUTES_CODE_ROOT_PATHÚ!RESOURCE_ATTRIBUTES_CODE_WORK_DIRÚ/RESOURCE_ATTRIBUTES_DEPLOYMENT_ENVIRONMENT_NAMEÚ/RESOURCE_ATTRIBUTES_VCS_REPOSITORY_REF_REVISIONÚ&RESOURCE_ATTRIBUTES_VCS_REPOSITORY_URLÚ	LevelName)ÚConsoleColorsValuesÚConsoleLogExporterÚIndentedConsoleSpanExporterÚShowParentsConsoleSpanExporterÚSimpleConsoleSpanExporter)ÚDynamicBatchSpanProcessor)Ú/CheckSuppressInstrumentationLogProcessorWrapperÚMainLogProcessorWrapper)Ú BodySizeCheckingOTLPSpanExporterÚOTLPExporterHttpSessionÚQuietLogExporterÚQuietSpanExporterÚRetryFewerSpansSpanExporter)Ú,CheckSuppressInstrumentationProcessorWrapperÚMainSpanProcessorWrapper)ÚQuietMetricExporter)ÚRemovePendingSpansExporter)ÚTestExporter)Úinstrument_executors)ÚProxyLoggerProvider)ÚProxyMeterProvider)ÚNOOP_SCRUBBERÚBaseScrubberÚScrubberÚScrubbingOptions)Úwarn_at_user_stacklevel)Ú
OPEN_SPANSÚPendingSpanProcessorÚProxyTracerProvider)ÚSeededRandomIdGeneratorÚensure_data_dir_existsÚhandle_internal_errorsÚplatform_is_emscriptenÚsuppress_instrumentation)ÚTextIO©ÚVariablesConfig©ÚLogfirezlogfire_credentials.jsonú
User-Agentúlogfire/z^[a-z0-9]+(?:-[a-z0-9]+)*$c                  ó–   • \ rS rSr% SrSrS\S'   SrS\S'    S	rS
\S'    S	r	S
\S'    Sr
S
\S'    SrS\S'    S	rS
\S'    SrS\S'   Srg)ÚConsoleOptionsé’   z'Options for controlling console output.Úautord   Úcolorsúshow-parentsz-Literal['simple', 'indented', 'show-parents']Ú
span_styleTÚboolÚinclude_timestampsÚinclude_tagsFÚverboseÚinforc   Úmin_log_levelÚshow_project_linkNzTextIO | NoneÚoutput© )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r‘   Ú__annotations__r“   r•   r–   r—   r™   rš   r›   Ú__static_attributes__rœ   ó    ÚU/home/mande/repo/quber/.venv/lib/python3.13/site-packages/logfire/_internal/config.pyrŽ   rŽ   ’   sr   ‡ á1à"(€FÐÓ(Ø@N€JÐ=ÓNØ-Ø#Ð˜Ó#Ø>Ø€L�$ÓØ8Ø€GˆTÓðð  &€M�9Ó%Ø7à"Ð�tÓ"ØOØ €FˆMÓ ÚIr¤   rŽ   c                  ó¦   • \ rS rSr% SrSrS\S'    \R                  " S S9r	S\S	'    \
R                  rS
\S'    SrS\S'    SrS\S'    SS jrSrg)ÚAdvancedOptionsé«   z9Options primarily used for testing by Logfire developers.Nú
str | NoneÚbase_urlc                 ó   • [        S 5      $ ©N)r�   rœ   r¤   r¥   Ú<lambda>ÚAdvancedOptions.<lambda>µ   s   € ÔJaÐbfÔJgr¤   ©Údefault_factoryr?   Úid_generatorzCallable[[], int]Úns_timestamp_generatorrœ   zSequence[LogRecordProcessor]Úlog_record_processorszExceptionCallback | NoneÚexception_callbackc                óJ   • U R                   b  U R                   $ [        U5      $ r¬   )rª   Úget_base_url_from_token©ÚselfÚtokens     r¥   Úgenerate_base_urlÚ!AdvancedOptions.generate_base_urlË   s!   € Ø�=‰=Ñ$Ø—=‘=Ð ä& uÓ-Ð-r¤   ©r¹   ÚstrÚreturnr½   )r�   rž   rŸ   r    r¡   rª   r¢   Údataclassesr   r±   ÚtimeÚtime_nsr²   r³   r´   rº   r£   rœ   r¤   r¥   r§   r§   «   sk   ‡ áCà€HˆjÓðð
 !,× 1Ò 1ÑBgÑ h€L�+Óhðð
 15·±ÐÐ-Ó<ØEà:<ÐÐ7Ó<Ø[à37ÐÐ0Ó7ð÷.r¤   r§   c                  óX   • \ rS rSr% SrSrS\S'    \" \S9r	S\S'    \" \S9r
S\S	'   S
rg)ÚPydanticPluginéÒ   zzOptions for the Pydantic plugin.

This class is deprecated for external use. Use `logfire.instrument_pydantic()` instead.
Úoffr[   Úrecordr¯   zset[str]ÚincludeÚexcluderœ   N)r�   rž   rŸ   r    r¡   rÆ   r¢   r   ÚsetrÇ   rÈ   r£   rœ   r¤   r¥   rÃ   rÃ   Ò   s?   ‡ ñð
 */€FÐ&Ó.ðñ ¨cÑ2€GˆXÓ2ØsÙ¨cÑ2€GˆXÓ2Ú8r¤   rÃ   c                  ó    • \ rS rSr% Sr\" S\" 5       S9\" \\" 5       S9\" \	S1 SkS94r
S	\S
'    SrS\S'    SrS\S'    \" S S9rS\S'   Srg)ÚMetricsOptionséé   zConfiguration of metrics.z
otel.sdk.*)Úinstrument_nameÚaggregation)Úinstrument_typerÎ   zhttp.server.active_requests>   ú
url.schemeúhttp.flavorúhttp.methodúhttp.schemeúhttp.request.method)rÏ   rÍ   Úattribute_keyszClassVar[Sequence[View]]ÚDEFAULT_VIEWSrœ   zSequence[MetricReader]Úadditional_readersFr”   Úcollect_in_spansc                 ó"   • [         R                  $ r¬   )rË   rÖ   rœ   r¤   r¥   r­   ÚMetricsOptions.<lambda>  s
   € ¼.×:VÒ:Vr¤   r¯   zSequence[View]ÚviewsN)r�   rž   rŸ   r    r¡   r8   r6   r-   r7   r2   rÖ   r¢   r×   rØ   r   rÛ   r£   rœ   r¤   r¥   rË   rË   é   sˆ   ‡ á#ñ 	Ø(Ù'Ó)ñ	
ñ 	Ø%Ù=Ó?ñ	
ñ 	Ø)Ø9òñ
	
ð/€MÐ+ó ð*ð 24ÐÐ.Ó3Ørà"Ð�dÓ"Øeá!Ñ2VÑW€Eˆ>ÓWòr¤   rË   c                  ó@   • \ rS rSr% SrS\S'    S\S'    SrS\S'   Srg	)
Ú
CodeSourcei!  z,Settings for the source code of the project.r½   Ú
repositoryÚrevisionÚ Ú	root_pathrœ   N)r�   rž   rŸ   r    r¡   r¢   rá   r£   rœ   r¤   r¥   rÝ   rÝ   !  s$   ‡ á6àƒOØRàƒMØSà€IˆsÓòr¤   rÝ   c                  óˆ   • \ rS rSr% SrSrS\S'    \" SS9rS\S	'    S
r	S\S'    Sr
S\S'    SrS\S'    SrS\S'    S rSrg)ÚVariablesOptionsi:  zËConfiguration for managed variables using the Logfire remote API.

This is the recommended configuration for production use. Variables are managed
through the Logfire UI and fetched via the Logfire API.
Tr”   Úblock_before_first_resolveé<   )Úsecondsztimedelta | floatÚpolling_interval)é
   rè   ztuple[float, float]ÚtimeoutÚ&include_resource_attributes_in_contextÚinclude_baggage_in_contextÚ
instrumentc                ó¸   • [        U R                  [        5      (       a  U R                  R                  5       OU R                  nUS:  a  [	        SU S35      eg )Nrè   z2polling_interval must be at least 10 seconds, got uJ   s. Polling is only a fallback â€” updates are delivered instantly via SSE.)Ú
isinstancerç   r   Útotal_secondsÚ
ValueError)r¸   Úinterval_secondss     r¥   Ú__post_init__ÚVariablesOptions.__post_init__S  sk   € ô ˜$×/Ñ/´×;Ñ;ð ×!Ñ!×/Ñ/Ô1à×&Ñ&ð 	ð
 ˜bÓ ÜØDÐEUÐDVð WZð Zóð ð !r¤   rœ   N)r�   rž   rŸ   r    r¡   rä   r¢   r   rç   ré   rê   rë   rì   rò   r£   rœ   r¤   r¥   rã   rã   :  sk   ‡ ñð (,Ð Ó+ØXÙ*3¸BÑ*?ÐÐ'Ó?ðð
 $,€GÐ Ó+ØgØ37Ð*¨DÓ7ØXØ'+Ð Ó+ØLØ€J�ÓØ;õ
r¤   rã   c                  óT   • \ rS rSr% SrS\S'    SrS\S'    SrS\S'    SrS\S	'   S
r	g)ÚLocalVariablesOptionsi`  z¹Configuration for managed variables using a local in-memory configuration.

Use this for development, testing, or self-hosted setups where you don't
want to connect to the Logfire API.
rˆ   ÚconfigTr”   rê   rë   rì   rœ   N)
r�   rž   rŸ   r    r¡   r¢   rê   rë   rì   r£   rœ   r¤   r¥   rõ   rõ   `  s;   ‡ ñð ÓØCØ37Ð*¨DÓ7ØXØ'+Ð Ó+ØLØ€J�ÓÚ;r¤   rõ   c                  ó   • \ rS rSrSrg)ÚDeprecatedKwargsir  rœ   N©r�   rž   rŸ   r    r£   rœ   r¤   r¥   rø   rø   r  s   † âr¤   rø   FT)ÚlocalÚsend_to_logfirer¹   Úapi_keyÚservice_nameÚservice_versionÚenvironmentÚconsoleÚ
config_dirÚdata_dirÚadditional_span_processorsÚmetricsÚ	scrubbingÚinspect_argumentsÚsamplingÚ	min_levelÚadd_baggage_to_attributesÚcode_sourceÚ	variablesÚdistributed_tracingÚadvancedc                óX  • SSK JnJn  UR                  SS5      nUb  [	        S5      eUR                  SS5      nUb  [	        S5      eUR                  SS5      nUS	L a  [	        S
5      eUb  [	        S5      eUR                  SS5      nUR                  SS5      nU(       d  U(       a.  Ub  [	        S5      e[
        R                  " S5        [        UUS9nUR                  SS5      nUb  [
        R                  " S5        UR                  SS5      nUb1  U(       a  [	        S5      e[        US9n[
        R                  " S5        UR                  SS5      nUb  [
        R                  " S5        S HU  n UR                  U S5      n!U!c  M  Ub  [	        SU  S35      e[        S,0 U U!0D6n[
        R                  " SU  SU  S3SS9  MW     UR                  S S5      n"U"(       a-  Ub  [	        S!5      e[
        R                  " S"5        [        U"S#9nUR                  S$S5      n#U#b$  [
        R                  " S%5        S&S'KJn$  U$" U#5        U(       a  [        S(S)R                  U5       35      eU (       a  [        5       n%O[         n%U%R#                  UUUUUUUUU(       a  [%        U5      OSU	(       a  [%        U	5      OSU
UUUUUUUUUS*9  U (       a  U" U%S+9n&OUn&U%R&                  b<  U%R)                  5       R+                  U%R&                  R,                  (       a  U&OS5        U&$ )-a  Configure the logfire SDK.

Args:
    local: If `True`, configures and returns a `Logfire` instance that is not the default global instance.
        Use this to create multiple separate configurations, e.g. to send to different projects.
    send_to_logfire: Whether to send logs to logfire.dev.

        Defaults to the `LOGFIRE_SEND_TO_LOGFIRE` environment variable if set, otherwise defaults to `True`.
        If `if-token-present` is provided, logs will only be sent if a token is present.

    token: The project write token(s). Can be a single token string or a list of tokens to send data
        to multiple projects simultaneously (useful for project migration).

        Defaults to the `LOGFIRE_TOKEN` environment variable (supports comma-separated tokens).

    api_key: API key for the Logfire API.

        If not provided, will be loaded from the `LOGFIRE_API_KEY` environment variable.

    service_name: Name of this service.

        Defaults to the `LOGFIRE_SERVICE_NAME` environment variable.

    service_version: Version of this service.

        Defaults to the `LOGFIRE_SERVICE_VERSION` environment variable, or the current git commit hash if available.

    environment: The environment this service is running in, e.g. `'staging'` or `'prod'`. Sets the
        [`deployment.environment.name`](https://opentelemetry.io/docs/specs/semconv/resource/deployment-environment/)
        resource attribute. Useful for filtering within projects in the Logfire UI.

        Defaults to the `LOGFIRE_ENVIRONMENT` environment variable.

    console: Whether to control terminal output. If `None` uses the `LOGFIRE_CONSOLE_*` environment variables,
        otherwise defaults to `ConsoleOption(colors='auto', indent_spans=True, include_timestamps=True, include_tags=True, verbose=False)`.
        If `False` disables console output. It can also be disabled by setting `LOGFIRE_CONSOLE` environment variable to `false`.

    config_dir: Directory that contains the `pyproject.toml` file for this project. If `None` uses the
        `LOGFIRE_CONFIG_DIR` environment variable, otherwise defaults to the current working directory.

    data_dir: Directory to store credentials, and logs. If `None` uses the `LOGFIRE_CREDENTIALS_DIR` environment variable, otherwise defaults to `'.logfire'`.
    additional_span_processors: Span processors to use in addition to the default processor which exports spans to Logfire's API.
    metrics: Set to `False` to disable sending all metrics,
        or provide a `MetricsOptions` object to configure metrics, e.g. additional metric readers.
    scrubbing: Options for scrubbing sensitive data. Set to `False` to disable.
    inspect_arguments: Whether to enable
        [f-string magic](https://logfire.pydantic.dev/docs/guides/onboarding-checklist/add-manual-tracing/#f-strings).
        If `None` uses the `LOGFIRE_INSPECT_ARGUMENTS` environment variable.

        Defaults to `True` if and only if the Python version is at least 3.11.

        Also enables magic argument inspection in [`logfire.instrument_print()`][logfire.Logfire.instrument_print].

    min_level:
        Minimum log level for logs and spans to be created. By default, all logs and spans are created.
        For example, set to 'info' to only create logs with level 'info' or higher, thus filtering out debug logs.
        For spans, this only applies when `_level` is explicitly specified in `logfire.span`.
        Changing the level of a span _after_ it is created will be ignored by this.
        If a span is not created, this has no effect on the current active span, or on logs/spans created inside the
        filtered `logfire.span` context manager.
        If set to `None`, uses the `LOGFIRE_MIN_LEVEL` environment variable; if that is not set, there is no minimum level.
    sampling: Sampling options. See the [sampling guide](https://logfire.pydantic.dev/docs/guides/advanced/sampling/).
    add_baggage_to_attributes: Set to `False` to prevent OpenTelemetry Baggage from being added to spans as attributes.
        See the [Baggage documentation](https://logfire.pydantic.dev/docs/reference/advanced/baggage/) for more details.
    code_source: Settings for the source code of the project.
    variables: Options related to managed variables.
    distributed_tracing: By default, incoming trace context is extracted, but generates a warning.
        Set to `True` to disable the warning.
        Set to `False` to suppress extraction of incoming trace context.
        See [Unintentional Distributed Tracing](https://logfire.pydantic.dev/docs/how-to-guides/distributed-tracing/#unintentional-distributed-tracing)
        for more information.
        This setting always applies globally, and the last value set is used, including the default value.
    advanced: Advanced options primarily used for testing by Logfire developers.
rR   )ÚDEFAULT_LOGFIRE_INSTANCErŠ   Ú
processorsNzŠThe `processors` argument has been replaced by `additional_span_processors`. Set `send_to_logfire=False` to disable the default processor.Úmetric_readersz°The `metric_readers` argument has been replaced by `metrics=logfire.MetricsOptions(additional_readers=[...])`. Set `send_to_logfire=False` to disable the default metric reader.Úcollect_system_metricsFzjThe `collect_system_metrics` argument has been removed. System metrics are no longer collected by default.zjThe `collect_system_metrics` argument has been removed. Use `logfire.instrument_system_metrics()` instead.Úscrubbing_callbackÚscrubbing_patternszsCannot specify `scrubbing` and `scrubbing_callback` or `scrubbing_patterns` at the same time. Use only `scrubbing`.z¡The `scrubbing_callback` and `scrubbing_patterns` arguments are deprecated. Use `scrubbing=logfire.ScrubbingOptions(callback=..., extra_patterns=[...])` instead.)ÚcallbackÚextra_patternsÚproject_namez9The `project_name` argument is deprecated and not needed.Útrace_sample_ratezkCannot specify both `trace_sample_rate` and `sampling`. Use `sampling.head` instead of `trace_sample_rate`.©ÚheadziThe `trace_sample_rate` argument is deprecated. Use `sampling=logfire.SamplingOptions(head=...)` instead.Úshow_summaryz„The `show_summary` argument is deprecated. Use `console=False` or `console=logfire.ConsoleOptions(show_project_link=False)` instead.)rª   r±   r²   zCannot specify `z&` and `advanced`. Use only `advanced`.zThe `z@` argument is deprecated. Use `advanced=logfire.AdvancedOptions(z=...)` instead.)Ú
stacklevelÚadditional_metric_readersz†Cannot specify both `additional_metric_readers` and `metrics`. Use `metrics=logfire.MetricsOptions(additional_readers=[...])` instead.zThe `additional_metric_readers` argument is deprecated. Use `metrics=logfire.MetricsOptions(additional_readers=[...])` instead.)r×   Úpydantic_pluginzZThe `pydantic_plugin` argument is deprecated. Use `logfire.instrument_pydantic()` instead.r   )Úset_pydantic_plugin_configz.configure() got unexpected keyword arguments: z, )rû   r¹   rü   rý   rþ   rÿ   r   r  r  r  r  r  r  r  r  r	  r
  r  r  r  ©rö   rœ   )rà   r  rŠ   Úpoprð   ÚwarningsÚwarnr|   rM   r§   rË   Úlogfire.integrations.pydanticr  Ú	TypeErrorÚjoinÚLogfireConfigÚGLOBAL_CONFIGÚ	configurer	   r  Úget_variable_providerÚstartrì   )'rú   rû   r¹   rü   rý   rþ   rÿ   r   r  r  r  r  r  r  r  r  r	  r
  r  r  r  Údeprecated_kwargsr  rŠ   r  r  r  r  r  r  r  r  ÚkeyÚvaluer  r  r  rö   Úlogfire_instances'                                          r¥   r)  r)  w  sŸ  € ÷F 5à"×&Ñ& |°TÓ:€JØÑÜðLó
ð 	
ð
 '×*Ñ*Ð+;¸TÓB€NØÑ!ÜðPó
ð 	
ð /×2Ñ2Ð3KÈTÓRÐØ Ò&ÜØxó
ð 	
ð Ñ)ÜØxó
ð 	
ð +×.Ñ.Ð/CÀTÓJÐØ*×.Ñ.Ð/CÀTÓJÐÞÖ/ØÑ Üð(óð ô 	�Šðdô	
ô %Ð.@ÐQcÑdˆ	à$×(Ñ(¨¸Ó>€LØÑÜ�ŠØGô	
ð '8×&;Ñ&;Ð<OÐQUÓ&VÐØÑ$ÞÜðFóð ô
 'Ð,=Ñ>ˆHÜ�MŠMðLôð
 %×(Ñ(¨¸Ó>€LØÑÜ�Šðhô	
ó
 FˆØ&×*Ñ*¨3°Ó5ˆØ‰=ÙØÑÜÐ/°¨uÐ4ZÐ[Ó\Ð\ä"Ñ2 c¨5 \Ñ2ˆÜ�ŠØ�C�5ÐXÐY\ÐX]Ð]lÐmØô	
ñ Fð &7×%:Ñ%:Ð;VÐX\Ó%]ÐÞ ØÑÜðZóð ô 	�ŠðVô	
ô !Ð4MÑNˆà,×0Ñ0Ð1BÀDÓI€OØÑ"Ü�ŠØhô	
õ 	Má" ?Ô3æÜÐHÈÏÉÐSdÓIeÐHfÐgÓhÐhæÜ“‰äˆØ
×ÑØ'ØØØ!Ø'ØØØÞ'1”4˜
Ô#°tÞ#+”�h”°Ø#=ØØ+ØØØ";ØØØ/Øð) ñ ö. Ù"¨&Ñ1Ñà3Ðð ×ÑÑ#Ø×$Ñ$Ó&×,Ñ,À×AQÑAQ×A\×A\Ñ-=ÐbfÔgàÐr¤   c                  óP  • \ rS rSr% SrS\S'    S\S'    S\S'    S	\S
'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S \S!'    S"\S#'                                              S'S$ jrS%rg&)(Ú_LogfireConfigDataio  a§  Data-only parent class for LogfireConfig.

This class can be pickled / copied and gives a nice repr,
while allowing us to keep the ugly stuff only in LogfireConfig.

In particular, using this dataclass as a base class of LogfireConfig allows us to use
`dataclasses.asdict` in `integrations/executors.py` to get a dict with just the attributes from
`_LogfireConfigData`, and none of the attributes added in `LogfireConfig`.
z"bool | Literal['if-token-present']rû   ústr | list[str] | Noner¹   r©   rü   r½   rý   rþ   rÿ   ú&ConsoleOptions | Literal[False] | Noner   r	   r  úSequence[SpanProcessor] | Noner  z!ScrubbingOptions | Literal[False]r  r”   r  rM   r  Úintr  r	  úCodeSource | Noner
  ú/VariablesOptions | LocalVariablesOptions | Noner  úbool | Noner  r§   r  c                óÖ  • [         R                  " U5      =U l        nUR                  SU5      U l        [        U5      =(       d    [        UR                  SS5      5      U l        U=(       d    UR                  S5      U l        UR                  SU5      U l        UR                  SU5      U l	        UR                  SU5      U l
        UR                  SU	5      U l        UR                  S	U5      U l        UR                  S
U5      U l        UR                  S5      U l        UR                  SU5      nUc  SnO[        U[         5      (       a	  ["        U   nXðl        UU l        [        U[(        5      (       a  [+        S!0 UD6nUc
  [+        5       nXÀl        U(       a   [/        UR0                  UR2                  5      O[4        U l        [        U[(        5      (       a  [9        S!0 UD6nUb  Xpl        O™UR                  S5      SL a  SU l        O}[9        UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      S9U l        [        U[(        5      (       a  [=        S!0 UD6nOUc  [=        UR                  S5      S9nXàl        [        U[(        5      (       a  [A        S!0 UD6nUU l!        [        U[(        5      (       as  URE                  SS5      n[        U[(        5      (       a0  SU;   a  SSK#J$n  U" S!0 UD6n[K        S!SU0UD6nO*[M        S!0 UDUD6nOUb  [K        S!SU0UD6nO[M        S!0 UD6nUU l'        [        U[(        5      (       a\  [Q        S!0 UD6nURR                  n[        U[(        5      (       a/  [U        URW                  5       5      SS/:X  a  [Y        S!0 UD6Ul)        OUc  [Q        UR                  S5      S 9nUU l-        X l.        SU l/        Uc
  [a        5       nX°l1        U R                  c   [e        5       U l	        gg! [f         a     gf = f)"zNMerge the given parameters with the environment variables file configurations.rû   r¹   Nrü   rý   rþ   rÿ   r  r  r  Úignore_no_configr  r   r   FÚconsole_colorsÚconsole_span_styleÚconsole_include_timestampÚconsole_include_tagsÚconsole_verboseÚconsole_min_log_levelÚconsole_show_project_link)r‘   r“   r•   r–   r—   r™   rš   r  r  rö   r  r‡   ÚseedÚ_ms_timestamp_generatorrª   )rª   rœ   )4rZ   ÚcreateÚparam_managerÚ
load_paramrû   r\   r¹   rü   rý   rþ   rÿ   r  r  r  r:  rî   r½   r]   r  r	  Údictr|   r  r{   r  r  ry   ÚscrubberrŽ   r   rM   r  rÝ   r
  r!  Úlogfire.variablesrˆ   rõ   rã   r  r§   r±   ÚlistÚkeysr�   r  r  Ú_project_urlrË   r  Úget_git_revision_hashÚ	Exception)r¸   rû   r¹   rü   rý   rþ   rÿ   r   r  r  r  r  r  r  r  r  r	  r
  r  r  r  rE  rö   Ú_VariablesConfigr±   s                            r¥   Ú_load_configurationÚ&_LogfireConfigData._load_configuration±  s  € ô6 .:×-@Ò-@ÀÓ-LÐLˆÔ˜]à,×7Ñ7Ð8IÈ?Ó[ˆÔä$ UÓ+×g¬¸}×?WÑ?WÐX_ÐaeÓ?fÓ/gˆŒ
Ø×E -×":Ñ":¸9Ó"EˆŒØ)×4Ñ4°^À\ÓRˆÔØ,×7Ñ7Ð8IÈ?Ó[ˆÔØ(×3Ñ3°MÀ;ÓOˆÔØ%×0Ñ0°¸XÓFˆŒØ!.×!9Ñ!9Ð:MÐO`Ó!aˆÔØ#0×#;Ñ#;Ð<QÐSfÓ#gˆÔ Ø -× 8Ñ 8Ð9KÓ LˆÔØ!×,Ñ,¨[¸)ÓDˆ	ØÑØ‰IÜ˜	¤3×'Ñ'Ü% iÑ0ˆIØ"ŒØ)BˆÔ&ô �i¤×&Ñ&ä(Ñ5¨9Ñ5ˆIØÑÜ(Ó*ˆIØ<EŒæFOŒH�Y×-Ñ-¨y×/AÑ/AÔBÔUbð 	Œô �gœt×$Ñ$ä$Ñ/ wÑ/ˆGØÑØ"�LØ×%Ñ% iÓ0°EÒ9Ø ˆD�Lä)Ø$×/Ñ/Ð0@ÓAØ(×3Ñ3Ð4HÓIØ#0×#;Ñ#;Ð<WÓ#XØ*×5Ñ5Ð6LÓMØ%×0Ñ0Ð1BÓCØ+×6Ñ6Ð7NÓOØ"/×":Ñ":Ð;VÓ"WñˆDŒLô �h¤×%Ñ%ä&Ñ2¨Ñ2‰HØÑÜ&Ø"×-Ñ-Ð.AÓBñˆHð !Œä�k¤4×(Ñ(ä$Ñ3 {Ñ3ˆKØ&ˆÔä�i¤×&Ñ&à—]‘] 8¨TÓ2ˆFÜ˜&¤$×'Ñ'Ø &Ó(ÝUá-Ñ7°Ñ7�FÜ 5Ñ Q¸VÐ QÀyÑ Q‘Iä 0Ñ G°6Ð G¸YÑ G‘IØÑ#ä1ÑM¸ÐMÀ9ÑM‘	ä,Ñ9¨yÑ9�	Ø"ˆŒä�h¤×%Ñ%ä&Ñ2¨Ñ2ˆHØ#×0Ñ0ˆLÜ˜,¬×-Ñ-´$°|×7HÑ7HÓ7JÓ2KÐPVÐXqÐOrÓ2rÜ(?Ñ(OÀ,Ñ(O�Ô%øØÑÜ&°×0HÑ0HÈÓ0TÑUˆHØ ˆŒà*DÔ'Ø(,ˆÔà‰?Ü$Ó&ˆGØŒà×ÑÑ'ðÜ'<Ó'>�Õ$ð (øô ó ñ ðús   Ñ
Q Ñ
Q(Ñ'Q()rL  r	  r  r  rü   r
  r   r  r  rÿ   r:  r  r  r  rE  r  rH  r  rû   rý   rþ   r¹   r  N©*rû   ú)bool | Literal['if-token-present'] | Noner¹   r2  rü   r©   rý   r©   rþ   r©   rÿ   r©   r   r3  r  úPath | Noner  rT  r  r4  r  ú&MetricsOptions | Literal[False] | Noner  ú(ScrubbingOptions | Literal[False] | Noner  r8  r  úSamplingOptions | Noner  úint | LevelName | Noner	  r”   r
  r6  r  r7  r  r8  r  úAdvancedOptions | Noner¾   ÚNone)r�   rž   rŸ   r    r¡   r¢   rP  r£   rœ   r¤   r¥   r1  r1  o  s™  ‡ ñð 8Ó7Ø4à!Ó!ØaàÓØSàÓØ#àÓØ&àÓØ5à3Ó3Ø1àƒNØ1à >Ó>Ø%à0Ó0ØDàÓØ+àÓØàƒNØ=à#Ó#ØBà"Ó"Ø6à>Ó>Ø0à$Ó$Ø4àÓØLðDð
 CðDð &ðDð ðDð !ðDð $ðDð  ðDð 8ðDð  ðDð ðDð %CðDð 8ðDð  <ð!Dð" 'ð#Dð$ )ð%Dð& *ð'Dð( $(ð)Dð* 'ð+Dð, Cð-Dð. )ð/Dð0 )ð1Dð2 
÷3Dr¤   r1  c                  ór  • \ rS rSr                    S                                         SS jjr                                          SS jrSS jrSS jrSSS jjrSS jr	SS	 jr
SS
 jrSS jrSS jrSS jrSS jrS rSS jrSrg)r'  i8  Nc                óH  • U R                  UUUUUUUUU	U
UUUUUUUUUUS9  [        [        R                  " 5       U 5      U l        [        [        5       5      U l        [        5       U l	        [        [        5       5      U l        SU l        SU l        [        5       U l        g)z¤Create a new LogfireConfig.

Users should never need to call this directly, instead use `logfire.configure`.

See `_LogfireConfigData` for parameter documentation.
)rû   r¹   rü   rý   rþ   rÿ   r   r  r  r  r  r  r  r  r  r	  r
  r  r  r  FN)rP  r€   r   ÚNoOpTracerProviderÚ_tracer_providerrx   r   Ú_meter_providerrO   Ú_variable_providerrw   r   Ú_logger_providerÚ_has_set_providersÚ_initializedr
   Ú_lock)r¸   rû   r¹   rü   rý   rþ   rÿ   r   r  r  r  r  r  r  r  r  r	  r  r
  r  r  s                        r¥   Ú__init__ÚLogfireConfig.__init__9  s¶   € ð> 	× Ñ Ø+ØØØ%Ø+Ø#ØØ!ØØ'AØØØ/ØØØ&?Ø#ØØ 3Øð) 	!ñ 	
ô0 !4´E×4LÒ4LÓ4NÐPTÓ UˆÔô  2Ô2CÓ2EÓFˆÔÜ4HÓ4JˆÔÜ 3Ô4FÓ4HÓ IˆÔà"'ˆÔØ!ˆÔÜ“Wˆ�
r¤   c                óÆ   • U R                      SU l        U R                  UUUUUUUUU	U
UUUUUUUUUU5        U R                  5         S S S 5        g ! , (       d  f       g = f)NF)rd  rc  rP  Ú
initialize)r¸   rû   r¹   rü   rý   rþ   rÿ   r   r  r  r  r  r  r  r  r  r	  r
  r  r  r  s                        r¥   r)  ÚLogfireConfig.configure{  ss   € ð. �Z‹ZØ %ˆDÔØ×$Ñ$ØØØØØØØØØØ*ØØØ!ØØØ)ØØØ#Øô)ð, �O‰OÔ÷1 �ZŽZús   �<AÁ
A c                óp   • U R                      U R                  5         SSS5        g! , (       d  f       g= f)z:Configure internals to start exporting traces and metrics.N)rd  Ú_initialize©r¸   s    r¥   rh  ÚLogfireConfig.initialize¬  s   € à�Z‹ZØ×ÑÔ÷ �ZŽZús   �'§
5c                óŠ  ^ ^/^0^1^2^3^4^5^6^7^8• T R                   (       a  g [        5       n[        5          T R                  [        R
                  " 5       [        R                  R                  [        5       [        R                  S.nT R                  (       a}  UR                  [        T R                  R                  [        T R                  R                   05        T R                  R"                  (       a  T R                  R"                  U[$        '   T R&                  (       a  T R&                  US'   T R(                  (       a  T R(                  U[*        '   [        R,                  " [.        5      nU(       aJ  UR1                  S5       H5  nUR1                  SSS9u  pVUR3                  5       X%R3                  5       '   M7     [        U;   a&  [        U;   a  [        R4                  " 5       U[6        '   [8        R:                  " U5      m4[9        S[=        5       R>                  05      RA                  T45      m4T RB                  RD                  nS n[G        U[H        [J        45      (       a  US:  a  [M        U5      nOUn[O        UT4T RP                  RR                  S9m7T RT                  RW                  5         T RT                  RY                  T75        / m3/ m8[[        5       m0S+U0U3U U84S	 jjn	T R\                  (       a  U	" [_        5       5        T R`                  b  T R`                   H  n
U	" U
5        M     [c        T RP                  Rd                  5      nT Rf                  (       Ga  T Rf                  Rh                  S
:X  a  [j        nOCT Rf                  Rh                  S:X  a  [l        nO"T Rf                  Rh                  S:X  d   e[n        nU" T Rf                  Rp                  T Rf                  Rr                  T Rf                  Rt                  T Rf                  Rv                  T Rf                  Rx                  T Rf                  Rz                  S9nU	" [}        U5      5        UR                  [�        [ƒ        U5      5      5        S n[G        T R„                  [†        5      (       a  [c        T R„                  Rˆ                  5      nT RŠ                  (       Ga–  T Rf                  =(       a    T Rf                  RŒ                  =(       d    Sm5 [Ž        R‘                  T R’                  5      nT R–                  (       dj  T RŠ                  SL a[  UcX  [˜        Rš                  " T RP                  Rœ                  5      n[Ž        RŸ                  US9nUR¡                  T R’                  5        Ub€  T R–                  =(       d    UR–                  T lK        T RP                  Rœ                  =(       d    UR¢                  T RP                  lN        T R¤                  =(       d    UR¦                  T lR        T R–                  (       Ga4  [G        T R–                  [¨        5      (       a  T R–                  /OT R–                  m6[«        5       m2U(       aB  T5(       a;  UR–                  T6;   a+  UR­                  5         T2R¯                  UR–                  5        U2U U5U64S jnU(       a  U" 5         O[±        USS9nUR³                  5         T6 GHp  nT RP                  Rµ                  U5      nS[¶         3US.n[¹        5       n[»        [½        US5      U[¾        RÀ                  US9n[Ã        U5      n[Å        U5      n[Ç        U5      nU(       a  [}        U5      nO[É        U5      nU	" U5        UbT  U(       dM  UR                  [Ë        [Í        [Ï        [½        US5      UU[¾        RÀ                  [Ð        S9[Ð        S95      5        [Ó        [½        US5      UU[¾        RÀ                  S9n[Õ        U5      nU(       a  [�        U5      nO[×        U5      nUR                  U5        URØ                  R                  U5        GMs     / nT3(       ag  [[        5       nT3 H  n
URÛ                  U
5        M     UR                  [Ý        T RP                  RR                  [ß        UT Rà                  5      5      5        URã                  T85        T0nT RB                  Rä                  (       aM  S nU(       a$  [[        5       nU H  nURÛ                  U5        M     [ç        T0T RB                  Rä                  US9nOU H  nT0RÛ                  U5        M     T7RÛ                  [é        [ß        UT Rà                  5      5      5        [        R,                  " [ê        5      n [        R,                  " [ì        5      n![        R,                  " [î        5      n"[        R,                  " [ð        5      n#[        R,                  " [ò        S5      Rõ                  5       n$[        R,                  " [ö        S5      Rõ                  5       n%[        R,                  " [ø        S5      Rõ                  5       n&U (       d  U!(       a  U$S;   a  U	" [û        [ý        5       5      5        U (       d  U"(       a   U%S;   a  Ub  U[Ë        [Ï        5       5      /-  nU (       d  U#(       aE  U&S;   a?  U(       a  [�        [Ó        5       5      nO[×        [Ó        5       5      nUR                  U5        Ub�  [G        T R„                  [†        5      (       d   e[ÿ        UT4T R„                  GR                   S 9m1U HH  n'G[        [”        5         G[        U'GR                  5      " SG[	        5       5      U'lƒ        S S S 5        MJ     OG[	        5       m1G[        [        S!5      (       a  U/U1U4U74S" jn([        GR                  " U(S#9  T GR                  RW                  S$S%9  T GR                  GR                  T15        T GR                  RW                  S$S%9  T GR                  c  G[        5       T l‰        Oã[G        T GR                  G[        5      (       a*  S&S'K�JŽn)  U)" T GR                  GR                  5      T l‰        O˜G[!        T GR                  G["        5        S&S(K’J“n*  T GR(                  (       d  G[+        S)5      eT RP                  Rœ                  =(       d    G[-        T GR(                  5      nU*" UT GR(                  T GR                  S*9T l‰        G[/        5       n+U H  n
U+GR1                  U
5        M     G[3        G[5        U+T Rà                  5      5      n,G[7        T45      m/T/GR1                  U,5        T GR8                  RW                  5         T GR8                  RY                  T/5        T GR8                  GR;                  T GR<                  5        T G[>        L ai  T GR@                  (       dW  ST l         G[B        GRD                  " T RT                  5        G[        T GR                  5        G[G        T GR8                  5        G[H        R                  G[J        GRL                  " T 5      5        ST l         G[O        5         G[Q        5       n-[G        U-G[R        G[T        45      (       a,  U-GRV                  n-[G        U-G[R        G[T        45      (       a  M,  T GRX                  c  G[S        U-5      n.O!T GRX                  (       a  U-n.OG[U        U-5      n.G[[        U.5        T GR]                  5         S S S 5        g ! [”         a    T R–                  (       d  e S n G
Nyf = f! , (       d  f       GM?  = f! , (       d  f       g = f),N)zservice.nameúprocess.pidzprocess.runtime.namezprocess.runtime.versionzprocess.runtime.descriptionzservice.versionÚ,Ú=rV   )Úmaxsplitzservice.instance.id)ÚsamplerÚresourcer±   c                ó$  >• TR                   R                  (       a$  [        U SS5      (       a  TR                  U 5        OTR	                  U 5        [        [        U SS 5      [        [        [        45      nU(       a  TR                  U 5        g g )NÚtail_sampling_defer_on_startFÚspan_exporter)	r  ÚtailÚgetattrÚappendÚadd_span_processorrî   ru   rt   rh   )Úspan_processorÚhas_pendingÚmain_multiprocessorÚprocessors_with_pending_spansr¸   Úuser_deferred_processorss     €€€€r¥   r{  Ú5LogfireConfig._initialize.<locals>.add_span_processorû  sv   ø€ Ø—=‘=×%×%¬'°.ÐB`Ðbg×*hÑ*hØ,×3Ñ3°NÕCà'×:Ñ:¸>ÔJÜ(Ü˜N¨O¸TÓBÜ!Ô#=Ô?XÐYó�ö Ø1×8Ñ8¸ÕHð r¤   ÚsimpleÚindentedr’   )r‘   Úinclude_timestampr–   r—   r™   r›   FT©Úclientc                 ó  >• [        5          T H^  n TR                  U 5      nUc  M  TR                  =(       d    UR                  Tl        T(       d  MF  U T;  d  MN  UR	                  5         M`     S S S 5        g ! , (       d  f       g = fr¬   )r…   Ú"_initialize_credentials_from_tokenrL  Úproject_urlÚprint_token_summary)r¹   Úvalidated_credentialsÚprinted_tokensr¸   rš   Ú
token_lists     €€€€r¥   Úcheck_tokensÚ/LogfireConfig._initialize.<locals>.check_tokensW  sj   ø€ Ü5Õ7Û)3 Ø8<×8_Ñ8_Ð`eÓ8fÐ 5Ø#8Ó#DØ8<×8IÑ8I×8nÐMb×MnÑMn DÔ$5ß'8Ð'8¸UÈ.Õ=XØ(=×(QÑ(QÖ(Sñ *4÷ 8×7Ö7ús   ŒA:¨)A:ÁA:ÁA:Á:
BÚcheck_logfire_token)ÚtargetÚnamerŒ   )r‹   ÚAuthorizationz
/v1/traces)ÚendpointÚsessionÚcompressionÚheadersz/v1/metrics)r”  r—  r•  r–  Úpreferred_temporality)r˜  z/v1/logs)r”  r•  r—  r–  )Údeferred_processorrà   )Úotlprà   )r  rt  rÛ   Úregister_at_forkc                 óÎ   >• [            TR                  [        S[        R                  " 5       05      5      n U Tl        U Tl        U Tl        S S S 5        g ! , (       d  f       g = f)Nro  )rƒ   Úmerger9   ÚosÚgetpidÚ	_resource)Únew_resourceÚlogger_providerÚmeter_providerrt  Útracer_providers    €€€€r¥   Úfix_pidÚ*LogfireConfig._initialize.<locals>.fix_pidò  sH   ø€ Þ/Ø'/§~¡~´hÀÌrÏyÊyË{Ð?[Ó6\Ó']˜Ø4@˜Ô1Ø3?˜Ô0Ø4@˜Ô1÷	 0×/Ö/ús   ˆAAÁ
A$)Úafter_in_childéÈ   ©Útimeout_millisr   )ÚLocalVariableProvider©ÚLogfireRemoteVariableProviderzyRemote variables require an API key. Set the LOGFIRE_API_KEY environment variable or pass api_key to logfire.configure().©rª   r¹   Úoptions)r|  r:   r¾   rZ  )¯rc  r„   r…   rý   rž  rŸ  ÚsysÚimplementationr’  Úget_runtime_versionÚversionr
  Úupdaterb   rÞ   ra   rß   rá   r^   rþ   rÿ   r`   Úgetenvr+   ÚsplitÚstripÚgetcwdr_   r9   rD  r   Úhexr�  r  r  rî   r5  Úfloatr@   ÚSDKTracerProviderr  r±   r^  ÚshutdownÚset_providerr;   r	  rK   r  rJ  r³   r   r“   rh   rf   rg   r‘   r•   r–   r—   r™   r›   r>   rz  r&   re   r  rË   r×   rû   rš   ÚLogfireCredentialsÚload_creds_filer  rN  r¹   rX   Úfrom_urlrª   Úinitialize_projectÚwrite_creds_fileÚlogfire_api_urlrL  r‰  r½   rÉ   rŠ  Úaddr   r+  rº   rQ   rm   rl   r   r   ÚGzipro   rp   rt   ri   r5   rs   r   ÚMETRICS_PREFERRED_TEMPORALITYr   rn   r%   r—  r{  r   rr   rH  Úextendrx  rN   rq   r'   r*   r)   r(   r   Úlowerr   r   r=   r   r.   rÛ   r   ÚtypeÚ_metricsr   Úhasattrr›  r_  r   r`  r  rO   rõ   Úlogfire.variables.localr«  rö   rH   rã   Úlogfire.variables.remoter­  rü   rL   r¶   r$   Úadd_log_record_processorrj   rk   ÚSDKLoggerProviderra  Úset_min_levelr  r(  rb  r   Úset_tracer_providerr   Ú_LOGFIRE_CONFIG_INSTANCESÚweakrefÚrefrv   r    rT   rS   Úwrappedr  r!   Ú_ensure_flush_after_aws_lambda)9r¸   Ú
emscriptenÚotel_resource_attributesÚ!otel_resource_attributes_from_envÚ_fieldr-  r.  r  rs  r{  Ú	processorr³   Úexporter_clsÚconsole_span_exporterr  Úcredentialsr†  rŽ  Úthreadr¹   rª   r—  r•  rw  Úlogfire_processorÚlog_exporterÚlogfire_log_processorÚdeferred_processorsÚpending_multiprocessorÚroot_processorÚdeferred_multiÚpÚotlp_endpointÚotlp_traces_endpointÚotlp_metrics_endpointÚotlp_logs_endpointÚotlp_traces_exporterÚotlp_metrics_exporterÚotlp_logs_exporterÚreaderr¥  r«  r­  Úmulti_log_processorÚroot_log_processorÚcurrent_textmapÚnew_textmapr¢  r~  r£  rŒ  r  rt  rš   r�  r¤  r€  s9   `                                              @@@@@@@@@@r¥   rk  ÚLogfireConfig._initialize±  s  ÿú€ Ø××Øä+Ó-ˆ
ä%Õ'à $× 1Ñ 1Ü!Ÿyšy›{ä(+×(:Ñ(:×(?Ñ(?Ü+>Ó+@Ü/2¯{©{ñ
8Ð$ð ××Ø(×/Ñ/ä>À×@PÑ@P×@[Ñ@[ÜGÈ×IYÑIY×IbÑIbðôð ×#Ñ#×-×-ØSW×ScÑSc×SmÑSmÐ,Ô-OÑPØ×#×#Ø>B×>RÑ>RÐ(Ð):Ñ;Ø××Ø\`×\lÑ\lÐ(Ô)XÑYÜ02·	²	Ô:RÓ0SÐ-Þ0Ø?×EÑEÀcÖJ�FØ!'§¡¨c¸A Ð!>‘J�CØ<A¿K¹K»MÐ,¯Y©Y«[Ó9ñ Kô 7Ð:RÓRÜCÐG_Ó_äNPÏiÊiËkÐ(Ô)JÑKä—’Ð'?Ó@ˆHô  Ð!6¼»¿¹Ð DÓE×KÑKÈHÓUˆHà—=‘=×%Ñ%ˆDØ&*ˆGÜ˜$¤¤e ×-Ñ-Ø˜!“8Ü5°dÓ;�Gøà�Ü/ØØ!Ø!Ÿ]™]×7Ñ7ñˆOð ×!Ñ!×*Ñ*Ô,Ø×!Ñ!×.Ñ.¨Ô?àACÐ)Ø<>Ð$Ü"?Ó"AÐ÷
Iò 
Ið ×-×-Ù"Ô#GÓ#IÔJà×.Ñ.Ñ:Ø!%×!@Ô!@�IÙ& yÖ1ñ "Aô %)¨¯©×)LÑ)LÓ$MÐ!à�|�|ˆ|Ø—<‘<×*Ñ*¨hÓ6Ü#<‘LØ—\‘\×,Ñ,°
Ó:Ü#>‘LàŸ<™<×2Ñ2°nÓDÐDÐDÜ#A�LÙ(4ØŸ<™<×.Ñ.Ø&*§l¡l×&EÑ&EØ!%§¡×!:Ñ!:Ø ŸL™L×0Ñ0Ø"&§,¡,×"<Ñ"<ØŸ<™<×.Ñ.ñ)Ð%ñ #Ô#6Ð7LÓ#MÔNØ%×,Ñ,Ô-EÔFXÐYnÓFoÓ-pÔqà8<ˆNÜ˜$Ÿ,™,¬×7Ñ7Ü!% d§l¡l×&EÑ&EÓ!F�à×#×#Ð#Ø*.¯,©,×*Y¸4¿<¹<×;YÑ;Y×*bÐ]bÐ!ð'Ü"4×"DÑ"DÀTÇ]Á]Ó"S�Kð —z—z d×&:Ñ&:¸dÒ&BÀ{ÑGZô +×3Ò3°D·M±M×4JÑ4JÓK�FÜ"4×"GÑ"GÈvÐ"GÐ"V�KØ×0Ñ0°·±Ô?àÑ*ð "&§¡×!@¨{×/@Ñ/@�D”JØ-1¯]©]×-CÑ-C×-bÀ{×GbÑGb�D—M‘MÔ*Ø(,×(9Ñ(9×(T¸[×=TÑ=T�DÔ%à—:—:�:ä1;¸D¿J¹JÌ×1LÑ1L $§*¡*¡ÐRV×R\ÑR\�Jô 03«u�Nö
 #Ö'8¸[×=NÑ=NÐR\Ó=\Ø#×7Ñ7Ô9Ø&×*Ñ*¨;×+<Ñ+<Ô=÷Tð Tö "Ù$�ä!'¨|ÐBWÑ!X˜ØŸ™œô ",˜Ø#'§=¡=×#BÑ#BÀ5Ó#I˜Ø3;¼G¸9Ð1EÐX]Ñ"^˜Ü"9Ó";˜Ü(HÜ%,¨X°|Ó%DØ$+Ü(3×(8Ñ(8Ø$+ñ	)˜ô ):¸-Ó(H˜Ü(CÀMÓ(R˜Ü(BÀ=Ó(Q˜Þ%ä0CÀMÓ0RÑ-ä0IÈ-Ó0XÐ-Ù*Ð+<Ô=ð *Ñ5¾jØ*×1Ñ1Ü =Ü$7Ü(:Ü5<¸XÀ}Ó5UØ4;Ø4;Ü8C×8HÑ8Hô C`ñ	)*ô ?\ñ%&ó!"ôô$ (7Ü%,¨X°zÓ%BØ$+Ø$+Ü(3×(8Ñ(8ñ	(˜ô (8¸Ó'E˜æ%ä4LÈ\Ó4ZÑ1ä4KÈLÓ4YÐ1Ø-×4Ñ4Ð5JÔKð
  Ÿ™×.Ñ.¨w×7ñw ",ðz 8:ÐÞ,Ü)FÓ)HÐ&Û!>�IØ*×=Ñ=¸iÖHñ "?à#×*Ñ*Ü(ØŸ™×2Ñ2Ô4LÐMcÐei×erÑerÓ4sóôð
  ×&Ñ&Ð'?Ô@à,?ˆNØ�}‰}×!×!Ø7;�Þ&Ü%BÓ%D�NÛ0˜Ø&×9Ñ9¸!Ö<ñ 1ä!6Ø'Ø—M‘M×&Ñ&Ø'5ñ"‘ó -�AØ'×:Ñ:¸1Ö=ñ -ð ×.Ñ.Ü<Ü,¨^¸T¿]¹]ÓKóôô ŸIšIÔ&AÓBˆMÜ#%§9¢9Ô-OÓ#PÐ Ü$&§I¢IÔ.QÓ$RÐ!Ü!#§¢Ô+KÓ!LÐÜ#%§9¢9Ô-AÀ2Ó#F×#LÑ#LÓ#NÐ Ü$&§I¢IÔ.CÀRÓ$H×$NÑ$NÓ$PÐ!Ü!#§¢Ô+=¸rÓ!B×!HÑ!HÓ!JÐæÖ!5Ð;OÐS_Ó;_Ù"Ô#5Ô6FÓ6HÓ#IÔJö Ö"7Ø)¨\Ó9Ø"Ñ.àÔ#@ÔASÓAUÓ#VÐ"WÑW�æÖ!3Ð9KÈ|Ó9[Þä,DÄ_ÓEVÓ,WÑ)ä,CÄOÓDUÓ,VÐ)Ø%×,Ñ,Ð-BÔCàÑ)Ü! $§,¡,´×?Ñ?Ð?Ð?Ü!.Ø#1Ø%ØŸ,™,×,Ò,ñ"�ó
 -�FÝ!¤)Õ,õ +/¨v¯ªÔ*?ÀÕDUÓDWÓ*X˜œ÷	 -Ñ,ò -õ "3Ó!4�å”rÐ-×.Ñ.÷Að Aô ×#Ó#°7Ò;ð × Ò ×)Ñ)Ø"ð *ñ ð × Ò ×3Ò3°NÔCà×#Ò#×,Ñ,¸CÐ,Ñ@Ø�~Š~Ñ%Ý*>Ó*@�Õ'Ü˜DŸNšNÕ,A×BÑBåIá*?ÀÇÂ×@UÒ@UÓ*V�Õ'å˜DŸNšNÕ,<Ô=åRð —|—|�|Ý,ðoóð ð
  Ÿ=™=×1Ñ1×ZÕ5LÈTÏ\Ê\Ó5Z�Ù*GØ%ØŸ,š,Ø ŸNšNñ+�Ô'õ
 #EÓ"FÐÛ2�	Ø#×<Ò<¸YÖGñ 3å!PÝ'Ð(;¸T¿]¹]ÓKó"Ðõ 0°Ó9ˆOØ×4Ò4Ð5GÔHØ×!Ò!×*Ñ*Ô,à×!Ò!×.Ñ.¨Ô?Ø×!Ò!×/Ò/°·²Ô?à•}Ò$¨T×-D×-DÐ-DØ*.�Ô'Ý×)Ó)¨$×*?Ñ*?Ô@Ý" 4×#7Ò#7Ô8Ý# D×$9Ò$9Ô:õ &×,Ñ,­W¯[«[¸Ó->Ô?à $ˆDÔõ !Ô"å0Ó2ˆOÜ˜_Õ/RÕTsÐ.t×uÑuØ"1×"9Ò"9�ô ˜_Õ/RÕTsÐ.t×uÓuà×'Ò'Ñ/ÝAÀ/ÓR‘Ø×)×)Ð)Ø-‘å=¸oÓN�Ý˜{Ô+à×/Ò/Ô1÷W (Ð'øôn !ó 'àŸ:Ÿ:ØØ"&“Kð	'ú÷t -×,ú÷c	 (Õ'úsQ   ²S~4Ô}<Ô$Y!~4î-~!î2M&~4üA~4ý<~þ~4þ~þ~4þ!
~1þ+	~4þ4
c                ó¤   • U R                   R                  U5        U R                  R                  U5        U R                  R                  U5      $ )z”Force flush all spans and metrics.

Args:
    timeout_millis: The timeout in milliseconds.

Returns:
    Whether the flush of spans was successful.
)r_  Úforce_flushra  r^  )r¸   rª  s     r¥   rö  ÚLogfireConfig.force_flushD  sC   € ð 	×Ñ×(Ñ(¨Ô8Ø×Ñ×)Ñ)¨.Ô9Ø×$Ñ$×0Ñ0°Ó@Ð@r¤   c                ó   • U R                   $ )z›Get a tracer provider from this `LogfireConfig`.

This is used internally and should not be called by users of the SDK.

Returns:
    The tracer provider.
)r^  rl  s    r¥   Úget_tracer_providerÚ!LogfireConfig.get_tracer_providerQ  ó   € ð ×$Ñ$Ð$r¤   c                ó   • U R                   $ )z™Get a meter provider from this `LogfireConfig`.

This is used internally and should not be called by users of the SDK.

Returns:
    The meter provider.
)r_  rl  s    r¥   Úget_meter_providerÚ LogfireConfig.get_meter_provider[  s   € ð ×#Ñ#Ð#r¤   c                ó   • U R                   $ )z›Get a logger provider from this `LogfireConfig`.

This is used internally and should not be called by users of the SDK.

Returns:
    The logger provider.
)ra  rl  s    r¥   Úget_logger_providerÚ!LogfireConfig.get_logger_providere  rû  r¤   c                ó‚   • U R                   n[        U[        5      (       a  U R                  c  U R	                  5       nU$ )au  Get a variable provider from this `LogfireConfig`.

This is used internally and should not be called by users of the SDK.

If no provider has been explicitly configured (i.e. `variables=` was not passed to
`configure()`), but a `LOGFIRE_API_KEY` is available, a `LogfireRemoteVariableProvider`
will be lazily created on the first call.

Returns:
    The variable provider.
)r`  rî   rO   r  Ú_lazy_init_variable_provider)r¸   Úproviders     r¥   r*  Ú#LogfireConfig.get_variable_providero  s9   € ð ×*Ñ*ˆÜ�hÔ 4×5Ñ5¸$¿.¹.Ñ:PØ×8Ñ8Ó:ˆHØˆr¤   c                ó,  • U R                      [        U R                  [        5      (       a  U R                  b  U R                  sSSS5        $ U R
                  =(       d    U R                  R                  S5      nU(       d  U R                  sSSS5        $ SSKJ	n  SSK
Jn  [        5       nU R                  R                  =(       d    [        U5      nU" UUUS9nX`l        UR!                  U" U S95        UsSSS5        $ ! , (       d  f       g= f)a  Attempt to lazily initialize a remote variable provider.

This is called when no explicit `variables=` option was passed to `configure()`,
but the user may have a `LOGFIRE_API_KEY` set in the environment. If so, we
create a `LogfireRemoteVariableProvider` with default options.
Nrü   r   r‰   r¬  r®  r   )rd  rî   r`  rO   r  rü   rE  rF  Úlogfire._internal.mainrŠ   rÍ  r­  rã   r  rª   r¶   r+  )r¸   rü   rŠ   r­  r¯  rª   r  s          r¥   r  Ú*LogfireConfig._lazy_init_variable_provider€  sÒ   € ð �Z‹Zä˜d×5Ñ5Ô7K×LÑLÐPT×P^ÑP^ÑPjØ×.Ñ.÷ ‰Zð
 —l‘l×N d×&8Ñ&8×&CÑ&CÀIÓ&NˆGÞØ×.Ñ.÷ ‰Zõ 7ÝNä&Ó(ˆGØ—}‘}×-Ñ-×QÔ1HÈÓ1QˆHÙ4Ø!ØØñˆHð
 '/Ô#Ø�N‰N™7¨$Ñ/Ô0Ø÷+ �Z�Zús   �8DÁA DÂA"DÄ
Dc                óÔ   • [         R                  " SS5      nUR                  5       S;   =(       d    U R                  nU R                  (       d  U(       d  [        U S3[        S9  g g g )NÚLOGFIRE_IGNORE_NO_CONFIGrà   )Ú1ÚtrueÚtz® until `logfire.configure()` has been called. Set the environment variable LOGFIRE_IGNORE_NO_CONFIG=1 or add ignore_no_config=true in pyproject.toml to suppress this warning.)Úcategory)rž  rµ  rÈ  r:  rc  r}   ÚLogfireNotConfiguredWarning)r¸   ÚmessageÚignore_no_config_envr:  s       r¥   Úwarn_if_not_initializedÚ%LogfireConfig.warn_if_not_initializedž  se   € Ü!ŸyšyÐ)CÀRÓHÐØ/×5Ñ5Ó7Ð;MÑM×fÐQU×QfÑQfÐØ× × Ö)9Ü#Ø�)ð Sð Tä4óð *:Ð r¤   c                óˆ   • [         R                  U[        R                  " 5       U R                  R                  U5      5      $ r¬   )r¾  Ú
from_tokenÚrequestsÚSessionr  rº   r·   s     r¥   rˆ  Ú0LogfireConfig._initialize_credentials_from_token¨  s0   € Ü!×,Ñ,¨U´H×4DÒ4DÓ4FÈÏÉ×HgÑHgÐhmÓHnÓoÐor¤   c                ó8  ^ • SU 4S jjn[        [        R                  R                  5       5       HI  n [	        USS5      nU(       d  M   U" UR                  5      Ul        U" UR                  5      Ul        MK     g! [
         a     M[  f = f! [
         a  n[        [
        5         [        U[        5      (       a  UR                  S:X  d   SSS5         SnAM­   SSS5        O! , (       d  f       O= fSSKnUR                  U5         SnAMã  SnAff = f)zûEnsure that `force_flush` is called after an AWS Lambda invocation.

This way Logfire will just work in Lambda without the user needing to know anything.
Without the `force_flush`, spans may just remain in the queue when the Lambda runtime is frozen.
c                óN   >^ • [         R                  " T 5      SU U4S jj5       nU$ )Nc                 ó|   >•  TR                  SS9  T" U 0 UD6$ ! [         a    SS KnUR                  5          N(f = f)Ni¸  r©  r   )rö  rN  Ú	tracebackÚ	print_exc)ÚargsÚkwargsr  Úclient_methodr¸   s      €€r¥   ÚwrapperÚiLogfireConfig._ensure_flush_after_aws_lambda.<locals>.wrap_client_post_invocation_method.<locals>.wrapper³  sK   ø€ ð*Ø×$Ñ$°DÐ$Ñ9ñ % dÐ5¨fÑ5Ð5øô !ó *Û$à×'Ñ'Ö)ð*ús   ƒ š;º;)r  r   r  r   r¾   r   )Ú	functoolsÚwraps)r   r!  r¸   s   ` €r¥   Ú"wrap_client_post_invocation_methodÚXLogfireConfig._ensure_flush_after_aws_lambda.<locals>.wrap_client_post_invocation_method²  s%   ù€ Ü�_Š_˜]Ó+÷6ó ,ð6ð ˆNr¤   ÚLambdaRuntimeClientNr   )r   r   )rJ  r°  ÚmodulesÚvaluesry  rN  Úpost_invocation_errorÚpost_invocation_resultr   rî   rÉ  r�   r  Úprint_exception)r¸   r%  Úmodr†  Úer  s   `     r¥   rÖ  Ú,LogfireConfig._ensure_flush_after_aws_lambda«  sê   ø€ ÷	ô& œŸ™×*Ñ*Ó,Ö-ˆCðÜ  Ð&;¸TÓB�ö Ùð-Ù/QÐRX×RnÑRnÓ/o�Ô,Ù0RÐSY×SpÑSpÓ0q�Ö-ò .øô ó Úðûô ó -ÜœiÕ(ô ' v¬t×4Ñ4¸¿¹ÐLaÓ9aØ ÷ )Õ(ð :b÷ )×(Ö(úó !à×)Ñ)¨!×,Ò,ûð-úsG   µA?Á.BÁ?
BÂBÂ
DÂDÂ)'C(ÃDÃ	DÃ(
C6Ã2DÄDc                óš   • U R                   R                  " U6   U R                  R                  " U6   U R                  R                  " U6   g r¬   )r^  Úsuppress_scopesr_  ra  )r¸   Úscopess     r¥   r1  ÚLogfireConfig.suppress_scopesß  s>   € Ø×Ñ×-Ò-¨vÑ6Ø×Ñ×,Ò,¨fÑ5Ø×Ñ×-Ò-¨vÒ6r¤   )	rb  rc  rd  ra  r_  rL  r^  r`  r¹   )NNNNNNNNNNNNNNNTNNNN)*rû   rS  r¹   r2  rü   r©   rý   r©   rþ   r©   rÿ   r©   r   r3  r  rT  r  rT  r  r4  r  rU  r  rV  r  r8  r  rW  r  rX  r	  r”   r  zVariablesOptions | Noner
  r6  r  r8  r  rY  r¾   rZ  rR  ©r¾   rZ  )i0u  )rª  r5  r¾   r”   )r¾   r€   )r¾   rx   )r¾   rw   )r¾   rP   )r  r½   )r¹   r½   r¾   zLogfireCredentials | None)r2  r½   r¾   rZ  )r�   rž   rŸ   r    re  r)  rh  rk  rö  rù  rý  r   r*  r  r  rˆ  rÖ  r1  r£   rœ   r¤   r¥   r'  r'  8  sH  † ð FJØ(,Ø"Ø#'Ø&*Ø"&Ø:>Ø"&Ø $ØEIØ:>Ø>BØ)-Ø+/Ø,0Ø*.Ø-1Ø)-Ø+/Ø+/ð+@àBð@ð &ð@ð ð	@ð
 !ð@ð $ð@ð  ð@ð 8ð@ð  ð@ð ð@ð %Cð@ð 8ð@ð <ð@ð 'ð@ð )ð@ð  *ð!@ð" $(ð#@ð$ +ð%@ð& 'ð'@ð( )ð)@ð* )ð+@ð, 
õ-@ðD/àBð/ð &ð/ð ð	/ð
 !ð/ð $ð/ð  ð/ð 8ð/ð  ð/ð ð/ð %Cð/ð 8ð/ð <ð/ð 'ð/ð )ð/ð  *ð!/ð" $(ð#/ð$ 'ð%/ð& Cð'/ð( )ð)/ð* )ð+/ð, 
ô-/ôbô
Q2öfAô%ô$ô%ôô"ô<ôpò2-÷h7r¤   r'  z list[weakref.ref[LogfireConfig]]rÒ  c                 ó~   • [        [        R                  " 5       5       H  n U R                  5         S U l        M     g )Nc                 ó   • g r¬   rœ   )Ú_Ú__s     r¥   r­   Ú!exit_open_spans.<locals>.<lambda>÷  s   €  Dr¤   )rJ  r~   r)  Úend)Úspans    r¥   Úexit_open_spansr<  é  s.   € ô ”Z×&Ò&Ó(Ö)ˆà�‰Œ
ñ )ˆŽò *r¤   c                óŽ   •  [        5         [         H  nU" 5       nUc  M  UR                  5         M!     [        U 5      $ !    N= fr¬   )r<  rÒ  rö  Úoriginal_os_exit)ÚcodeÚ
config_refrö   s      r¥   Úpatched_os_exitrA  ÿ  sG   € ðÜÔß3ˆJÙ“\ˆFØÓ!Ø×"Ñ"Ö$ñ 4ô ˜DÓ!Ð!øðÙús   ‚A  ¡A  Á Ac                  ó  • \ rS rSr% SrS\S'    S\S'    S\S'    S\S'    \SS j5       r\SS	 j5       r\S
S
S.         SS jj5       r	\S
SS
S.         SS jj5       r
\    SS j5       rSS jrSS jrSrg
)r¾  i  zCredentials for logfire.dev.r½   r¹   r  r‰  rÃ  c                ó¾  • [        U5      nUR                  5       (       aa   UR                  S5       n[        R                  " U5      nSSS5         WR                  SS5      nUb  UR                  SU5        U " S0 UD6$ g! , (       d  f       N?= f! [
        [        4 a  n[        SU 35      UeSnAff = f! [         a  n[        SU SU 35      UeSnAff = f)a
  Check if a credentials file exists and if so load it.

Args:
    creds_dir: Path to the credentials directory.

Returns:
    The loaded credentials or `None` if the file does not exist.

Raises:
    LogfireConfigError: If the credentials file exists but is invalid.
ÚrbNzInvalid credentials file: Údashboard_urlr‰  z - rœ   )Ú_get_creds_fileÚexistsÚopenÚjsonÚloadrð   ÚOSErrorrL   r!  Ú
setdefaultr%  )ÚclsÚ	creds_dirÚpathÚfÚdatar.  rE  s          r¥   r¿  Ú"LogfireCredentials.load_creds_file!  sÚ   € ô ˜yÓ)ˆØ�;‰;�=‰=ðUØ—Y‘Y˜t”_¨ÜŸ9š9 Q›<�D÷ %ð
[à $§¡¨¸$Ó ?�Ø Ñ,Ø—O‘O M°=ÔAÙ‘{˜T‘{Ð"ð ç$•_ûä¤Ð(ó UÜ(Ð+EÀdÀVÐ)LÓMÐSTÐTûðUûô ó [Ü(Ð+EÀdÀVÈ3ÈqÈcÐ)RÓSÐYZÐZûð[úsL   ¢B ³BÁ
B Á.B; Â
BÂB ÂB ÂB8Â$B3Â3B8Â;
CÃCÃCc                óþ  •  UR                  [        US5      S0 [        ESU0ES9nUR                  S:w  a;   UR                  5       S   n[
        R                  " S	UR                   S
U 35        gUR                  5       nU " UUS   US   US9$ ! [        R                   a#  n[
        R                  " SU 35         SnAgSnAff = f! [         a'    [
        R                  " S	UR                   S35         gf = f)a   Check that the token is valid.

Issue a warning if the Logfire API is unreachable, or we get a response other than 200 or 401.

We continue unless we get a 401. If something is wrong, we'll later store data locally for back-fill.

Raises:
    LogfireConfigError: If the token is invalid.
z/v1/inforè   r“  )ré   r—  zFLogfire API is unreachable, you may have trouble sending data. Error: Nr¨  Údetailz!Logfire API returned status code z
. Detail: z$, you may have trouble sending data.r  r‰  )r¹   r  r‰  rÃ  )
Úgetr   ÚCOMMON_REQUEST_HEADERSr  ÚRequestExceptionr"  r#  Ústatus_coderI  rN  )rM  r¹   r•  rª   Úresponser.  rT  rQ  s           r¥   r  ÚLogfireCredentials.from_token?  s  € ð	Ø—{‘{Ü˜ *Ó-ØØJÔ1ÐJ°?ÀEÑJð #ð ˆHð ×Ñ 3Ó&ð	Ø!Ÿ™›¨Ñ2�ô —’Ø7¸×8LÑ8LÐ7MÈZÐX^ÐW_Ð`ôð à�}‰}‹ˆÙØØ˜nÑ-Ø˜]Ñ+Ø$ñ	
ð 	
øô% ×(Ñ(ó 	Ü�MŠMÐbÐcdÐbeÐfÔgÜûð	ûô ó Ü—’Ø7¸×8LÑ8LÐ7MÐMqÐrõð ðús(   ‚%B ¸C ÂCÂ%CÃCÃ.C<Ã;C<N)Úorganizationr  c               óì  • SnSnSnUn[        [        R                  S9n	Ub'  U V
s/ s H  oªS   U:X  d  M  U
PM     nn
SU S3nSU 3nUb"  S	U S3nU V
s/ s H  oªS
   U:X  d  M  U
PM     nn
Ub   [        U5      S:X  a  US   S   nUS   S
   nO‚U(       d\  U(       d  U	R	                  S5        g[
        R                  " SU SU S3SS/SS9S:X  a  U	R	                  SU SU S35        gUnSnSnOUb  Uc  U	R	                  SU S35        SnSnUb  Ucµ  [        U5       VVs0 s H  u  p¼[        US-   5      US   US
   4_M     nnnSR                  UR                  5        VVs/ s H  u  p¼U SUS    SUS    3PM     snn5      n[
        R                  " SU S3[        UR                  5       5      SS9nXß   nUS   nUS   nUR                  X45      $ s  sn
f s  sn
f s  snnf s  snnf )a-  Configure one of the user projects to be used by Logfire.

It configures the project if organization/project_name is a valid project that
the user has access to it. Otherwise, it asks the user to select a project interactively.

Args:
    client: The Logfire client to use when making requests.
    projects: List of user projects.
    organization: Project organization.
    project_name: Name of project that has to be used.

Returns:
    The configured project information.

Raises:
    LogfireConfigError: If there was an error configuring the project.
rà   Úprojects)ÚfileNÚorganization_namez in organization `Ú`z --org zprojects with name `r  rV   r   z`No projects found for the current user. You can create a new project with `logfire projects new`zNo z found for the current userz. Choose from all projects?ÚyÚn©ÚchoicesÚdefaultzYou can create a new projectz with `logfire projects newzFound multiple Ú.Ú
z. Ú/z_Please select one of the following projects by number (requires the 'write_token' permission):
r  )rC   r°  ÚstderrÚlenÚprintrE   ÚaskÚ	enumerater½   r&  ÚitemsrJ  rK  Úcreate_write_token)rM  r†  r]  r[  r  Úorg_messageÚorg_flagÚproject_messageÚfiltered_projectsr   rç  ÚindexÚitemÚproject_choicesÚproject_choices_strÚselected_project_keyÚproject_info_tuples                    r¥   Úuse_existing_projectÚ'LogfireCredentials.use_existing_projecti  s«  € ð4 ˆØˆØ$ˆØ$ÐäœsŸz™zÑ*ˆàÑ#Ù,4Ó _ªH qÐ:MÑ8NÐR^Ñ8^§©HÐÐ _Ø.¨|¨n¸AÐ>ˆKØ   Ð/ˆHàÑ#Ø 4°\°NÀ!ÐDˆOÙ,=Ó cÒ,= qÀ>ÑARÐVbÑAb§Ñ,=ÐÐ càÑ#¬Ð,=Ó(>À!Ó(Cà,¨QÑ/Ð0CÑDˆLØ,¨QÑ/°Ñ?‰LÞ"ÞØ—‘Øvôð ä—
’
Ø˜/Ð*Ð*EÀkÀ]ÐRmÐnØ  #˜JØñð
 óð —‘Ð <¸[¸MÐIdÐemÐdnÐnoÐpÔqØà (ÐØˆLØ‰Lð Ñ'¨LÑ,@ð —‘ °Ð/@ÀÐBÔCØˆLØˆLàÑ <Ñ#7ô $-Ð->Ô#?ôâ#?‘K�Eô �E˜A‘I“ Ð&9Ñ!:¸DÀÑ<PÐ QÒQÙ#?ð ñ ð #'§)¡)ØDS×DYÑDYÔD[Ô\ÒD[±[°U�E�7˜"˜T !™W˜I Q t¨A¡w iÓ0ÑD[Ò\ó#Ðô $*§:¢:Ørð  tGð  sHð  HJð  KÜ˜_×1Ñ1Ó3Ó4Øñ$Ð ð
 3BÑ2WÐØ-¨aÑ0ˆLØ-¨aÑ0ˆLà×(Ñ(¨ÓDÐDùòw !`ùò !dùóJùó
 ]s"   §G ·G ÁG%Á'G%Ä(#G*Å,G0
F)r[  Údefault_organizationr  c               ó�  • UR                  5        Vs/ s H  oUS   PM	     nnX&;  a¶  [        U5      S:”  ae  UR                  5       nUR                  S0 5      R                  S5      nU(       a
  U(       a  UnOe[        R
                  " SUU=(       d    US   S9nOBUS   nU(       d6  [        R
                  " SU S3S	S
9n	U	(       d  [        R                  " S5        [        5       n
Sn U=(       d    [        R
                  " XºS
9nU(       a^  [        R                  " [        U5      (       d>  [        R
                  " SU
S
9nU(       a"  [        R                  " [        U5      (       d  M>   UR                  X$5      nU$ s  snf ! [         a    Sn
SU S3nSn M³  [         a  nSn
SUR                    S3nSn SnAMÖ  SnAff = f)a�  Create a new project and configure it to be used by Logfire.

It creates the project under the organization if both project and organization are valid.
Otherwise, it asks the user to select organization and enter a valid project name interactively.

Args:
    client: The Logfire client to use when making requests.
    organization: The organization name of the new project.
    default_organization: Whether to create the project under the user default organization.
    project_name: The default name of the project.

Returns:
    The created project information.

Raises:
    LogfireConfigError: If there was an error creating projects.
r_  rV   r|  z|
To create and use a new project, please provide the following information:
Select the organization to create the project inr   rc  z1The project will be created in the organization "z". Continue?T©re  zEnter the project namezâ
The project name you've entered is invalid. Valid project names:
  * may contain lowercase alphanumeric characters
  * may contain single hyphens
  * may not start or end with a hyphen

Enter the project name you want to use:.z
A project with the name 'z7' already exists. Please enter a different project nameNz*
The project name you entered is invalid:
z&
Please enter a different project name)Úget_user_organizationsrj  Úget_user_informationrU  rE   rl  rD   r°  ÚexitÚdefault_project_nameÚreÚmatchÚPROJECT_NAME_PATTERNÚcreate_new_projectrY   rW   Úreason)rM  r†  r[  r|  r  ru  ÚorganizationsÚuser_detailsÚuser_default_organization_nameÚconfirmÚproject_name_defaultÚproject_name_promptÚprojectÚexcs                 r¥   r†  Ú%LogfireCredentials.create_new_projectÈ  sÊ  € ð4 KQ×JgÑJgÔJiÓ#jÒJiÀ$Ð)<Ô$=ÑJiˆÐ#jàÓ,Ü�=Ó! AÓ%à%×:Ñ:Ó<�Ø=I×=MÑ=MÐNdÐfhÓ=i×=mÑ=mØ'ó>Ð.ö (Ö,JØ#A‘Lä#)§:¢:ðKà -Ø >× RÀ-ÐPQÑBRñ	$‘Lð  -¨QÑ/�Þ+Ü%ŸkškØKÈLÈ>ÐYeÐfÐptñ�Gö #ÜŸš œä$8Ó$:ÐØ6ÐØØ'×h¬6¯:ª:Ð6IÑ+hˆLÞ¤r§x¢xÔ0DÀl×'SÑ'SÜ%Ÿzšzð>ð
 1ñ �ö ¤r§x¢xÔ0DÀl×'SÓ'SðØ ×3Ñ3°LÓO�ð  �ùòw $køôX (ó Ø'*Ð$à1°,°Ð?vÐwð $ð  $�ÚÜ%ó Ø'*Ð$àBÀ3Ç:Á:À,ÐNuÐvð $ð  $�Ýûðús#   “FÅ.F ÆGÆ	GÆ&G Ç Gc               óˆ  • Sn[        S5        UR                  5       nU(       a+  [        R                  " SSS9nU(       a  U R	                  XS9nU(       d  U R                  US9n U " S0 UDSUR                  0D6n[        R                  " S	UR                   S
35        U$ ! [         a  n[        SU 35      UeSnAff = f)a$  Create a new project or use an existing project on logfire.dev requesting the given project name.

Args:
    client: The Logfire client to use when making requests.

Returns:
    The new credentials.

Raises:
    LogfireConfigError: If there was an error on creating/configuring the project.
NzbNo Logfire project credentials found.
All data sent to Logfire must be associated with a project.
z2Do you want to use one of your existing projects? Tr~  )r†  r]  r…  rÃ  zBProject initialized successfully. You will be able to view it at: z
Press Enter to continuez0Invalid credentials, when initializing project: rœ   )rk  Úget_user_projectsrD   rl  rz  r†  rª   rE   r‰  r%  rL   )rM  r†  rÞ  r]  Úuse_existing_projectsÚresultr.  s          r¥   rÁ  Ú%LogfireCredentials.initialize_project  sÜ   € ð" .2ˆäðLô	
ð
 ×+Ñ+Ó-ˆÞÜ$+§K¢KÐ0dÐnrÑ$sÐ!Þ$Ø!×6Ñ6¸fÐ6ÐX�æØ×0Ñ0¸Ð0Ð?ˆKð	dÙÑH˜;ÑH¸¿¹ÒHˆFÜ�JŠJØTÐU[×UgÑUgÐThð i*ð *ôð ˆMøÜó 	dÜ$Ð'WÐXYÐWZÐ%[Ó\ÐbcÐcûð	dús   Á';B# Â#
CÂ-B<Â<Cc                óª   • [        U5        [        R                  " U 5      n[        U5      nUR	                  [
        R                  " USS9S-   5        g)z+Write a credentials file to the given path.rR   )Úindentrg  N)r‚   r¿   ÚasdictrF  Ú
write_textrI  Údumps)r¸   rN  rQ  rO  s       r¥   rÂ  Ú#LogfireCredentials.write_creds_fileJ  s@   € ä˜yÔ)Ü×!Ò! $Ó'ˆÜ˜yÓ)ˆØ�‰œŸ
š
 4°Ñ2°TÑ9Õ:r¤   c                ó~   • U R                   (       a,  [        SU R                    S3[        U R                   5      S9  gg)z(Print a summary of the existing project.z([bold]Logfire[/bold] project URL: [cyan]z[/cyan])Úmin_content_widthN)r‰  Ú_print_summaryrj  rl  s    r¥   rŠ  Ú&LogfireCredentials.print_token_summaryQ  s9   € à××ÜØ:¸4×;KÑ;KÐ:LÈGÐTÜ"% d×&6Ñ&6Ó"7óð r¤   rœ   )rN  r	   r¾   úSelf | None)r¹   r½   r•  zrequests.Sessionrª   r½   r¾   r   )
r†  rX   r]  zlist[dict[str, Any]]r[  r©   r  r©   r¾   zdict[str, Any] | None)
r†  rX   r[  r©   r|  r”   r  r©   r¾   zdict[str, Any])r†  rX   r¾   rF   )rN  r	   r¾   rZ  r4  )r�   rž   rŸ   r    r¡   r¢   Úclassmethodr¿  r  rz  r†  rÁ  rÂ  rŠ  r£   rœ   r¤   r¥   r¾  r¾    s>  ‡ á&àƒJØ)ØÓØ"ØÓØ"ØÓØ#àó[ó ð[ð: ó'
ó ð'
ðR ð $(Ø#'ñ\Eð ð\Eð 'ð	\Eð
 !ð\Eð !ð\Eð 
ô\Eó ð\Eð| ð
 $(Ø%*Ø#'ñTð ðTð !ð	Tð
 #ðTð !ðTð 
ôTó ðTðl ð(dð ð(dð 
ó	(dó ð(dôT;÷r¤   r¾  c                óx   • SSK Jn  U" SS9nUR                  US-   :  a
  US-   Ul        UR                  U 5        g )Nr   rB   T©ri  é   )Úrich.consolerC   Úwidthrk  )r  r�  rC   r   s       r¥   rž  rž  Z  s9   € Ý$á˜TÑ"€GØ‡}�}Ð(¨1Ñ,Ó,Ø)¨AÑ-ˆŒØ‡M�M�'Õr¤   c                ó   • U [         -  $ )z%Get the path to the credentials file.)ÚCREDENTIALS_FILENAME)rN  s    r¥   rF  rF  c  s   € àÔ+Ñ+Ð+r¤   c                ó®   • Sn[         R                  " U 5      =n(       a+  UR                  S5      nUS:X  a  gUS:X  a  gU[        ;  a  Sn[        U   S   $ )z-Get the base API URL from the token's region.ÚusÚregionÚ	stagingusz https://logfire-us.pydantic.infoÚ	stagingeuz https://logfire-eu.pydantic.inforª   )rI   r„  ÚgrouprJ   )r¹   r«  r„  s      r¥   r¶   r¶   h  s_   € ð €FÜ.×4Ò4°UÓ;Ð;€uÕ;Ø—‘˜XÓ&ˆà�[Ó Ø5Ø�{Ó"Ø5àœÓ ØˆFä�6‰?˜:Ñ&Ð&r¤   c                 ó|   • SSK n U R                  / SQU R                  S9R                  S5      R	                  5       $ )z Get the current git commit hash.r   N)Úgitz	rev-parseÚHEADr£  Úascii)Ú
subprocessÚcheck_outputÚSTDOUTÚdecoder·  )r³  s    r¥   rM  rM  z  s7   € ãà×"Ñ"Ò#?È
×HYÑHYÐ"ÐZ×aÑaÐbiÓj×pÑpÓrÐrr¤   c                óf   • [         R                  " SSU 5      R                  5       SS =(       d    S$ )zSConvert `name` to a string suitable for the `requested_project_name` API parameter.z[^a-zA-Z0-9]rà   Né)   Úuntitled)rƒ  ÚsubrÈ  )r’  s    r¥   Úsanitize_project_namer»  �  s,   € ô �6Š6�/ 2 tÓ,×2Ñ2Ó4°S°bÐ9×G¸ZÐGr¤   c                 óx   • [        [        R                  R                  [        R                  " 5       5      5      $ r¬   )r»  rž  rO  Úbasenamer¸  rœ   r¤   r¥   r‚  r‚  ˆ  s"   € Ü ¤§¡×!1Ñ!1´"·)²)³+Ó!>Ó?Ð?r¤   c                 óú   • [         R                  R                  n U R                  S:X  a3  U R                  (       d"  SR                  [        [        U S S 5      5      $ SR                  [        [        U 5      5      $ )NÚfinalrf  é   )r°  r±  r³  ÚreleaselevelÚserialr&  Úmapr½   )Úversion_infos    r¥   r²  r²  Œ  s\   € Ü×%Ñ%×-Ñ-€LØ× Ñ  GÓ+°L×4G×4GØ�x‰xœœC ¨b¨qÐ!1Ó2Ó3Ð3Ø�8‰8”Cœ˜\Ó*Ó+Ð+r¤   c                  ó   • \ rS rSrSrg)r  i“  rœ   Nrù   rœ   r¤   r¥   r  r  “  s   † Úr¤   r  ).rú   r”   rû   rS  r¹   r2  rü   r©   rý   r©   rþ   r©   rÿ   r©   r   r3  r  úPath | str | Noner  rÆ  r  r4  r  rU  r  rV  r  r8  r  rW  r  rX  r	  r”   r
  r6  r  r7  r  r8  r  rY  r,  zUnpack[DeprecatedKwargs]r¾   rŠ   )r?  r5  )r  r½   r�  r5  r¾   rZ  )rN  r	   r¾   r	   r¼   )r¾   r½   )r’  r½   r¾   r½   )òÚ
__future__r   Ú_annotationsÚatexitr¿   r#  rI  rž  rƒ  r°  rÀ   r"  rÓ  Úcollections.abcr   Ú
contextlibr   r   r   Údatetimer   Úpathlibr	   Ú	threadingr
   r   Útypingr   r   r   r   r   r   Úurllib.parser   Úuuidr   r  Úopentelemetryr   Úopentelemetry._logsr   r   Ú#opentelemetry.environment_variablesr   r   r   Ú&opentelemetry.exporter.otlp.proto.httpr   Ú4opentelemetry.exporter.otlp.proto.http._log_exporterr   Ú6opentelemetry.exporter.otlp.proto.http.metric_exporterr   Ú5opentelemetry.exporter.otlp.proto.http.trace_exporterr   Úopentelemetry.metricsr   r   Úopentelemetry.propagater    r!   Úopentelemetry.sdk._logsr"   rÏ  r#   Ú!opentelemetry.sdk._logs._internalr$   Úopentelemetry.sdk._logs.exportr%   r&   Ú'opentelemetry.sdk.environment_variablesr'   r(   r)   r*   r+   Úopentelemetry.sdk.metricsr,   r-   r.   r/   r0   r1   r2   Ú opentelemetry.sdk.metrics.exportr3   r4   r5   Úopentelemetry.sdk.metrics.viewr6   r7   r8   Úopentelemetry.sdk.resourcesr9   Úopentelemetry.sdk.tracer:   r;   r<   r»  Úopentelemetry.sdk.trace.exportr=   r>   Ú$opentelemetry.sdk.trace.id_generatorr?   Ú opentelemetry.sdk.trace.samplingr@   rA   r¥  rC   Úrich.promptrD   rE   Útyping_extensionsrF   rG   rH   Úlogfire._internal.authrI   rJ   Úlogfire._internal.baggagerK   Úlogfire.exceptionsrL   Úlogfire.samplingrM   Úlogfire.sampling._tail_samplingrN   Úlogfire.variables.abstractrO   rP   Úlogfire.versionrQ   Ú	propagaterS   rT   ÚtypesrU   r†  rW   rX   rY   Úconfig_paramsrZ   r[   r\   Ú	constantsr]   r^   r_   r`   ra   rb   rc   Úexporters.consolerd   re   rf   rg   rh   Úexporters.dynamic_batchri   Úexporters.logsrj   rk   Úexporters.otlprl   rm   rn   ro   rp   Úexporters.processor_wrapperrq   rr   Úexporters.quiet_metricsrs   Úexporters.remove_pendingrt   Úexporters.testru   Úintegrations.executorsrv   Úlogsrw   r  rx   r  ry   rz   r{   r|   Ú
stack_infor}   Útracerr~   r   r€   Úutilsr�   r‚   rƒ   r„   r…   r†   rI  rˆ   ÚmainrŠ   r¨  rV  r…  ÚDELTAÚ
CUMULATIVErÆ  rŽ   r§   rÃ   rË   rÝ   rã   rõ   rø   r)  r1  r'  rÒ  r¢   Úregisterr<  Ú_exitr>  rA  r(  r¾  rž  rF  r¶   rM  r»  r‚  r²  ÚUserWarningr  rœ   r¤   r¥   Ú<module>r     s˜  ðÞ 2ã Û Û Û Û 	Û 	Û 
Û Û Û Ý $Ý ß (Ý Ý ß #ß M× MÝ  Ý ã Ý ß Gß oÑ oÝ >Ý PÝ UÝ Rß Gß Jß [Ý Pß \÷õ ÷÷ ñ ÷ qÑ pß gÑ gÝ 0ß uÑ uß RÝ <ß MÝ  ß 'ß 7Ñ 7ç JÝ JÝ 1Ý ,Ý Aß MÝ #ç \Ý %ß KÑ Kß TÑ T÷÷ ñ ÷õ õ ?ß d÷õ ÷ pÝ 8Ý @Ý (Ý 8Ý %Ý 'ß NÓ NÝ /ß IÑ I÷õ ö Ýå1åð 2Ð Ø +Ø&¨(°7°)Ð(<Ð=Ð Ø =Ø4Ð ð Ð#×)Ò)ØÐ)×4Ò4ØÐ%×+Ò+ØÐ-×3Ò3ØÐ3×>Ò>ØÐ+×6Ò6ð!Ð ðð ÷Jð Jó ðJð0 ÷#.ð #.ó ð#.ðL ÷9ð 9ó ð9ð, ÷4ð 4ó ð4ðn ÷ð ó ðð0 ÷"ð "ó ð"ðJ ÷<ð <ó ð<ô"	�yô 	ð ØAEØ$(ØØ#Ø"&Ø"Ø6:Ø$(Ø"&ØAEØ6:Ø:>Ø%)Ø'+Ø(,Ø&*Ø%)ØAEØ'+Ø'+ñ-uàðuð ?ðuð "ð	uð
 ðuð ðuð  ðuð ðuð 4ðuð "ðuð  ðuð !?ðuð 4ðuð 8ðuð #ðuð  %ð!uð" &ð#uð$  $ð%uð& #ð'uð( ?ð)uð* %ð+uð, %ð-uð. 2ð/uð0 õ1uðp ×Ñ÷Eð Eó ðEôPj
7Ð&ô j
7ð\ ?AÐ Ð;Ó @ð ‡‚ñ)ó ð)ð$ —8’8Ð ô	"ð €„ñ “€ð ×Ñ÷Bð Bó ðBôJ
ô,ô
'ô$sôHò@ô,ô	 +õ 	r¤   