
    g                   ,   d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlmZ d dlmZmZ d dlmZ d dlmZmZ d dlmZmZmZmZmZmZmZ d dlmZ d d	lm Z  d dl!Z!d d
l"m#Z# d dl$m%Z%m&Z& d dl'm(Z( d dl)m*Z* d dl+m,Z, d dl-m.Z.m/Z/ d dl0m1Z1m2Z2 d dl3m4Z4m5Z5m6Z6m7Z7m8Z8 d dl9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@ d dlAmBZBmCZCmDZD d dlEmFZFmGZG d dlHmIZI d dlJmKZKmLZLmMZN d dlOmPZPmQZQ d dlRmSZS d dlTmUZUmVZV d dlWmXZX d dlYmZZZ d dl[m\Z\m]Z] d dl^m_Z_m`Z` d dlambZb d dlcmdZd d d lemfZf d d!lgmhZh d"d#limjZjmkZk d$d%llmmZmmnZnmoZo d$d&lpmqZqmrZr d$d'lsmtZtmuZumvZvmwZwmxZxmyZymzZz d$d(l{m|Z|m}Z}m~Z~mZ d$d)lmZmZ d$d*lmZmZ d$d+lmZ d$d,lmZ d$d-lmZ d$d.lmZ d$d/lmZ d$d0lmZmZmZmZ d$d1lmZ d$d2lmZmZmZ d$d3lmZmZmZmZmZmZ erd$d4lmZ d5Z	 d6d7eh iZ	 d8Ze:eBjN                  e@eBjP                  e;eBjN                  e=eBjN                  e?eBjP                  e>eBjP                  iZ	 e G d9 d:             Ze G d; d<             Ze G d= d>             Ze G d? d@             Ze G dA dB             Z G dC dDe      ZdEdddddddddddddddddF	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dVdGZdWdHZej                   G dI dJ             Z G dK dLe      Z e       Zej                   G dM dN             ZdXdOZdYdPZdZdQZd[dRZdS Z G dT dUe      Zy)\    )annotationsN)suppress)	dataclassfield)Path)RLockThread)TYPE_CHECKINGAnyCallableLiteralSequence	TypedDictcast)urljoin)uuid4)trace)OTEL_METRICS_EXPORTEROTEL_TRACES_EXPORTER)Compression)OTLPMetricExporter)OTLPSpanExporter)NoOpMeterProviderset_meter_provider)get_global_textmapset_global_textmap)OTEL_BSP_SCHEDULE_DELAYOTEL_EXPORTER_OTLP_ENDPOINT#OTEL_EXPORTER_OTLP_METRICS_ENDPOINT"OTEL_EXPORTER_OTLP_TRACES_ENDPOINTOTEL_RESOURCE_ATTRIBUTES)Counter	HistogramMeterProviderObservableCounterObservableGaugeObservableUpDownCounterUpDownCounter)AggregationTemporalityMetricReaderPeriodicExportingMetricReader)%ExponentialBucketHistogramAggregationView)Resource)SpanProcessorSynchronousMultiSpanProcessorTracerProvider)BatchSpanProcessorSimpleSpanProcessor)IdGenerator)ParentBasedTraceIdRatioSampler)ResourceAttributesConsole)ConfirmPrompt)SelfUnpack)LogfireConfigError)SamplingOptions)TailSamplingProcessor)VERSION   )NoExtractTraceContextPropagator#WarnOnExtractTraceContextPropagator   )DEFAULT_FILEDefaultFileis_logged_in)ParamManagerPydanticPluginRecordValues)OTLP_MAX_BODY_SIZE"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IndentedConsoleSpanExporterShowParentsConsoleSpanExporterSimpleConsoleSpanExporter)OTLPExporterHttpSessionRetryFewerSpansSpanExporter),CheckSuppressInstrumentationProcessorWrapperMainSpanProcessorWrapper)QuietMetricExporter)RemovePendingSpansExporter)TestExporter)instrument_executors)ProxyMeterProvider)NOOP_SCRUBBERBaseScrubberScrubberScrubbingOptions)warn_at_user_stacklevel)
OPEN_SPANSPendingSpanProcessorProxyTracerProvider)SeededRandomIdGeneratorUnexpectedResponseensure_data_dir_existshandle_internal_errorsread_toml_filesuppress_instrumentation)Logfirezlogfire_credentials.json
User-Agentlogfire/z^[a-z0-9]+(?:-[a-z0-9]+)*$c                  n    e Zd ZU dZdZded<   dZded<   	 dZd	ed
<   	 dZd	ed<   	 dZ	ded<   	 dZ
d	ed<   y)ConsoleOptionsz'Options for controlling console output.autorR   colorsshow-parentsz-Literal['simple', 'indented', 'show-parents']
span_styleTboolinclude_timestampsFverboseinforQ   min_log_levelshow_project_linkN)__name__
__module____qualname____doc__rs   __annotations__ru   rw   rx   rz   r{        M/var/www/openai/venv/lib/python3.12/site-packages/logfire/_internal/config.pyrq   rq   z   sX    1"(F(@NJ=N-##>GT  &M9%7"t"Or   rq   c                  x    e Zd ZU dZdZded<   	  ej                  d       Zded<   	 e	j                  Zd	ed
<   y)AdvancedOptionsz9Options primarily used for testing by Logfire developers.z https://logfire-api.pydantic.devstrbase_urlc                     t        d       S N)rg   r   r   r   <lambda>zAdvancedOptions.<lambda>   s    JabfJgr   default_factoryr4   id_generatorzCallable[[], int]ns_timestamp_generatorN)r|   r}   r~   r   r   r   dataclassesr   r   timetime_nsr   r   r   r   r   r      sD    C6Hc6' 1 1 1Bg hL+h
 15-<Er   r   c                  \    e Zd ZU dZdZded<   	  ee      Zded<   	  ee      Z	ded<   y	)
PydanticPluginzOptions for the Pydantic plugin.

    This class is deprecated for external use. Use `logfire.instrument_pydantic()` instead.
    offrJ   recordr   zset[str]includeexcludeN)
r|   r}   r~   r   r   r   r   setr   r   r   r   r   r   r      s?    
 */F&. c2GX2sc2GX28r   r   c                       e Zd ZU dZdZded<   y)MetricsOptionszConfiguration of metrics.

    This only has one option for now, but it's a place to add more related options in the future.
    r   zSequence[MetricReader]additional_readersN)r|   r}   r~   r   r   r   r   r   r   r   r      s    
 24.3rr   r   c                  8    e Zd ZU dZded<   	 ded<   	 dZded<   y)
CodeSourcez,Settings for the source code of the project.r   
repositoryrevision 	root_pathN)r|   r}   r~   r   r   r   r   r   r   r   r      s$    6ORMSIsr   r   c                      e Zd Zy)DeprecatedKwargsNr|   r}   r~   r   r   r   r   r      s    r   r   F)localsend_to_logfiretokenservice_nameservice_versionenvironmentconsole
config_dirdata_diradditional_span_processorsmetrics	scrubbinginspect_argumentssamplingcode_sourcedistributed_tracingadvancedc                V   ddl m}m} |j                  dd      }|t	        d      |j                  dd      }|t	        d      |j                  dd      }|d	u rt	        d
      |t	        d      |j                  dd      }|j                  dd      }|s|r/|t	        d      t        j                  d       t        ||      }|j                  dd      }|t        j                  d       |j                  dd      }|.|rt	        d      t        |      }t        j                  d       |j                  dd      }|t        j                  d       dD ]S  }|j                  |d      }||t	        d| d      t        d,i ||i}t        j                  d| d| dd       U |j                  d d      }|r.|
t	        d!      t        j                  d"       t        |#      }
|j                  d$d      }|#t        j                  d%       d&d'lm}   | |       |rt        d(d)j                  |             | rt               }!nt         }!|!j#                  |||||||
|rt%        |      nd|rt%        |      nd|	||||||*       | r	 ||!+      S |S )-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 token.

            Defaults to the `LOGFIRE_TOKEN` 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, 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.

        sampling: Sampling options. See the [sampling guide](https://logfire.pydantic.dev/docs/guides/advanced/sampling/).
        code_source: Settings for the source code of the project.
        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.
    rB   )DEFAULT_LOGFIRE_INSTANCErm   
processorsNzThe `processors` argument has been replaced by `additional_span_processors`. Set `send_to_logfire=False` to disable the default processor.metric_readerszThe `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`.zThe `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_summaryzThe `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_readerszCannot 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   )configr   )r   r   rm   pop
ValueErrorwarningswarnrb   r?   r   r   logfire.integrations.pydanticr   	TypeErrorjoinLogfireConfigGLOBAL_CONFIG	configurer   )"r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   deprecated_kwargsr   rm   r   r   r   r   r   r   r   r   keyvaluer   r   r   r   s"                                     r   r   r      s\   Z 5"&&|T:JL
 	

 '**+;TBN!P
 	
 /223KTR&A
 	

 )A
 	

 +../CTJ*../CTJ/ (  	d	
 %.@Qcd	$((>LG	
 '8&;&;<OQU&V$F 
 ',=>HMML
 %((>Lh	

 F&**35=/u4Z[\\"2c5\2C5XY\X]]lm	
 F &7%:%:;VX\%] Z  	V	
 !4MN,001BDIO"h	
 	M"?3HSdIeHfghh
'!''14
#t#+h#=+/!  & f%%''r   c                H    t        j                  |       }|sy t        |      S r   )osgetenvint)env_varr   s     r   _get_int_from_envr     s     IIgEu:r   c                     e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 ded	<   	 d
ed<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)_LogfireConfigDataa  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 | Noner   r   r   r   r   &ConsoleOptions | Literal[False] | Noner   r   r   Sequence[SpanProcessor] | Noner   z!ScrubbingOptions | Literal[False]r   rv   r   r?   r   CodeSource | Noner   bool | Noner   r   r   c           
        t        j                  |      x| _        }|j                  d|      | _        |j                  d|      | _        |j                  d|      | _        |j                  d|      | _        |j                  d|      | _        |j                  d|      | _	        |j                  d|      | _
        |j                  d|      | _        |j                  d	      | _        | j                  r!t        j                  d
d dk  rt        d      t!        |t"              rt%        di |}|
t%               }|| _        |r t)        |j*                  |j,                        nt.        | _        t!        |t"              rt3        di |}||| _        n|j                  d      du rd| _        npt3        |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d            | _        t!        |t"              rt7        di |}n|t7        |j                  d            }|| _        t!        |t"              rt;        di |}|| _        t!        |t"              rVt?        di |}|j@                  }t!        |t"              rLtC        |jE                               ddgk(  r.tG        di ||_         n|t?        |j                  d            }|| _$        |	| _%        |

tM               }
|
| _'        | j                  	 tQ               | _        y
y
# tR        $ r Y y
w xY w)zNMerge the given parameters with the environment variables file configurations.r   r   r   r   r   r   r   r   ignore_no_configNrB   )      z[Inspecting arguments is only supported in Python 3.9+ and only recommended in Python 3.11+.r   Fconsole_colorsconsole_span_styleconsole_include_timestampconsole_verboseconsole_min_log_levelconsole_show_project_link)rs   ru   rw   rx   rz   r{   r   r   seed_ms_timestamp_generatorr   )r   r   )*rI   createparam_manager
load_paramr   r   r   r   r   r   r   r   r   sysversion_infor>   
isinstancedictrb   r   ra   r   r   r_   scrubberrq   r   r?   r   r   r   r   r   listkeysrg   r   r   r   r   get_git_revision_hash	Exception)selfr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s                      r   _load_configurationz&_LogfireConfigData._load_configuration  s,   . .:-@-@-LL],778I?["--gu=
)44^\R,778I?[(33M;O%00XF!.!9!9:MO`!a#0#;#;<QSf#g  - 8 89K L!!c&6&6r&:f&D$m 
 i&(595I(*I<EFOHY--y/A/ABUb 	 gt$$/w/G"DL%%i0E9 DL)$//0@A(334HI#0#;#;<W#X%001BC+667NO"/":":;V"WDL h%&22H&"--.ABH !k4($3{3K&h%&22H#00L,-$|7H7H7J2KPVXqOr2r(?(O,(O%&0H0H0TUH *D'?$&G''<'>$ (   s   6M 	MMN"r   )bool | Literal['if-token-present'] | Noner   r   r   r   r   r   r   r   r   r   r   Path | Noner   r   r   r   r   &MetricsOptions | Literal[False] | Noner   (ScrubbingOptions | Literal[False] | Noner   r   r   SamplingOptions | Noner   r   r   r   r   AdvancedOptions | NonereturnNone)r|   r}   r~   r   r   r   r   r   r   r   r     sI    874'#&5331N1 >>%00D+""6$$4Lg
 Cg g !g $g  g 8g  g g %Cg 8g <g  '!g" )#g$ '%g& )'g( ))g* 
+gr   r   c                     e Zd Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddZddZdddZddZddZ	dd	Z
dd
Zd ZddZy)r   Nc                    | j                  |||||||||	|
||||||       t        t        j                         |       | _        t        t                     | _        d| _        d| _	        t               | _        y)zCreate 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   FN)r   rf   r   NoOpTracerProvider_tracer_providerr^   r   _meter_provider_has_set_providers_initializedr   _lockr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s                    r   __init__zLogfireConfig.__init___  s    6 	  +%+#!'A/# 3! 	! 	
( !4E4L4L4NPT U  22C2EF"'!W
r   c                    | j                   5  d| _        | j                  |||||||||	|
||||||       | j                          d d d        y # 1 sw Y   y xY w)NF)r  r  r   
initializer  s                    r   r   zLogfireConfig.configure  sg    & ZZ %D$$*!#!$ OO) ZZs   8AAc                f    | j                   5  | j                          ddd       y# 1 sw Y   yxY w)z:Configure internals to start exporting traces and metrics.N)r  _initializer   s    r   r  zLogfireConfig.initialize  s    ZZ ZZs   '0c                    !"#$%  j                   ry t               5  t        j                   j                  t        j
                  t        j                         i} j                  rx|j                  t         j                  j                  t         j                  j                  i        j                  j                  r j                  j                  |t        <    j                   r j                   |t        j"                  <    j$                  r j$                  |t&        <   t        j(                  t*              }|rM|j-                  d      D ]9  }|j-                  dd      \  }}|j/                         ||j/                         <   ; t        |v r#t        |v rt        j0                         |t2        <   t5        j6                  |      #t5        t        j8                  t;               j<                  i      j?                  #      # j@                  jB                  }d }tE        |tF        tH        f      r|dk  rtK        |      }n|}tM        |# jN                  jP                        % jR                  jU                           jR                  jW                  %       g "tY               x} j@                  jZ                  r t]        | j@                  jZ                        }%j_                  ta        tc        | jd                                     d&"fd}	 jf                   jf                  D ]
  }
 |	|
         jh                  r̉ jh                  jj                  dk(  rtl        }nA jh                  jj                  dk(  rtn        }n! jh                  jj                  d	k(  sJ tp        } |	ts         | jh                  jt                   jh                  jv                   jh                  jx                   jh                  jz                  
                   d }tE         j|                  t~              rt         j|                  j                        } j                  rHd } jh                  xr  jh                  j                  xs d$ j                  t        j                   j                        } j                  du rZ|Xt        j                   jN                  j                  t        j                               }|j                   j                         |D|j                   _D         jN                  j                  xs |j                   jN                  _I         j                  8 $fd}t        |d      }|j                          dt          j                  d}t        t              }|j                  j                  |       t        t         jN                  j                  d      |t        j                        }t        |      }t        |      }t        t              xs d} |	t        ||             |\|t        t        t        t         jN                  j                  d      ||t        j                  t              t                    gz  }"retY               }"D ]  }
|j_                  |
        j_                  t         jN                  jP                  tc        | jd                                     t        j(                  t              }t        j(                  t              }t        j(                  t              }t        j(                  t        d      j                         }t        j(                  t        d      j                         }|s|r|dv r |	t        t                            |s|r|dv r||t        t                     gz  }|'t        |#t        t        t                     g       n
t                t        t        d      r #%fd }t        j                  |!        j                  jU                  d"#        j                  j                           t        u rG j                  s;d _r        t        j                   jR                         t         j                         t        j                  d$        t        j                  !d'! fd%}|t        _w        d _         t                t               }tE        |t        t        f      r#|j                  }tE        |t        t        f      r# j                  t        |      }n j                  r|}nt        |      }t        |        j                          d d d        y # 1 sw Y   y xY w)(N,=rE   )maxsplit)samplerresourcer   c                    j                  |        t        t        | dd       t        t        t
        f      }|rj                  |        y y )Nspan_exporter)add_span_processorr   getattrr\   r[   rU   append)span_processorhas_pendingmain_multiprocessorprocessors_with_pending_spanss     r   r  z5LogfireConfig._initialize.<locals>.add_span_processor  sK    #66~F(NOTB!#=?XY 188H r   simpleindentedrt   )rs   include_timestamprx   rz   FT)logfire_api_urlsessionc                     j                   J j                  j                         } r| | j                          y y y r   )r   "_initialize_credentials_from_tokenprint_token_summary)validated_credentialsr   r{   s    r   check_tokenz.LogfireConfig._initialize.<locals>.check_tokenL  sI    #zz555040W0WX\XbXb0c-,1F1R1EEG 2S,r   check_logfire_token)targetnamero   )rn   Authorization)max_body_sizez
/v1/traces)endpointr(  compressioni  )schedule_delay_millisz/v1/metrics)r3  headersr(  r4  preferred_temporality)r7  r   )otlpr   )instrument_typeaggregation)r   r  viewsregister_at_forkc                     t               5  j                  t        t        j                  t        j                         i            } | _        | _        d d d        y # 1 sw Y   y xY wr   )rj   merger.   r7   PROCESS_PIDr   getpid	_resource)new_resourcemeter_providerr  tracer_providers    r   fix_pidz*LogfireConfig._initialize.<locals>.fix_pid  sN    /1'/~~h@R@^@^`b`i`i`k?l6m'n4@13?0 211s   AA  A))after_in_child   timeout_millisc                 \    t        t              D ]  } | j                          d | _         y )Nc                      y r   r   )___s     r   r   zDLogfireConfig._initialize.<locals>.exit_open_spans.<locals>.<lambda>  s    r   )r   rd   end)spans    r   exit_open_spansz2LogfireConfig._initialize.<locals>.exit_open_spans  s%     !,DHHJ  5DH -r   c                R    	          j                           |       S #  Y xY wr   )force_flush)coderP  original_os_exitr   s    r   patched_os_exitz2LogfireConfig._initialize.<locals>.patched_os_exit  s1    #%$$& (--s   " &)r   r/   r  r  )rS  r   )r  rl   r7   SERVICE_NAMEr   r?  r   r@  r   updaterP   r   rO   r   r   rL   r   SERVICE_VERSIONr   rN   r   r!   splitstripgetcwdrM   r.   r   SERVICE_INSTANCE_IDr   hexr>  r   r   r   r   floatr5   SDKTracerProviderr   r   r	  shutdownset_providerr0   tailr@   r  rX   rY   r   r   r   ru   rU   rS   rT   r3   rs   rw   rx   rz   r   r   r   r   r   r{   r   LogfireCredentialsload_creds_filer   initialize_projectr   requestsSessionwrite_creds_filer'  r	   startrA   rV   rK   r6  r   r   r   GziprW   r[   r   r   r2   r+   rZ   r   METRICS_PREFERRED_TEMPORALITYre   r   r    r   r   lowerr   r$   r-   r#   r,   r   hasattrr<  r
  r   r   r  r   set_tracer_provideratexitregister_exitr]   r   rD   rC   wrappedr   r   _ensure_flush_after_aws_lambda)&r   otel_resource_attributes!otel_resource_attributes_from_env_fieldr   r   r   r  root_processorr  	processorexporter_clsr   credentialsr-  threadr6  r(  r  r5  pending_multiprocessorotlp_endpointotlp_traces_endpointotlp_metrics_endpointotlp_traces_exporterotlp_metrics_exporterrE  rU  current_textmapnew_textmaprP  r"  rC  rT  r#  r  r{   rD  s&   `                             @@@@@@@@r   r  zLogfireConfig._initialize  s   %'"//1B1B"..		8$ (//>@P@P@[@[GIYIYIbIb ##--SWScScSmSm,-OP##OSOcOc();)K)KL\`\l\l()XY02		:R0S-0?EEcJF!'cA!>JC<AKKM,SYY[9 K 7:RRCG__NPiik()JK'?@H  !3!G!G UV\\]efH==%%D&*G$e-!85d;G/!!]]77O !!**,!!..?AC)3P3RRN0}}!!!6~t}}GYGY!Z..<,^T]]KI ..:!%!@!@I&y1 "A ||<<**h6#<L\\,,
:#>L<<22nDDD#AL"'$#'<<#6#6.2ll.M.M$(LL$8$8*.,,*D*D		 9=N$,,7!%dll&E&E!F##9=*.,,*Y4<<;Y;Y*b]b! ::%"4"D"DT]]"SK ++t38K&8&K&K,0MM,B,B$,$4$4$6 'L ' $44T]]C".%0%6%6
151G1G1f;KfKf.::)H $;=RSFLLN/7y-ATXT^T^_G5DVWGOO**73$4!()?)?!N '$/$4$4%M
 %@$NM$>}$MM,=>U,V,]Z])&'9-_t'uv%1&9 3$6189O9OQ^1_07074?4D4D ?\	%& ;X!"+ $ -)F)H&!>I*==iH "? $66(224LMceierer4s II&ABM#%99-O#P $&II.Q$R!#%99-A2#F#L#L#N $&II.CR$H$N$N$P!!5;OS_;_"#56F6H#IJ "7)\9".#@ASAU#V"WW)!.#1%,5(M(O	" "3!4r-.@ ##7;   ))" *    33NC}$T-D-D*.'))$*?*?@"4#7#78__5 5"  "xx. 'BH $D !"02O_/RTs.tu"1"9"9 _/RTs.tu''/A/R))-=oN{+//1s (''s   ef;%Af;;gc                n    | j                   j                  |       | j                  j                  |      S )zForce flush all spans and metrics.

        Args:
            timeout_millis: The timeout in milliseconds.

        Returns:
            Whether the flush of spans was successful.
        )r
  rR  r	  )r   rI  s     r   rR  zLogfireConfig.force_flush  s/     	((8$$00@@r   c                    | j                   S )zGet 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	  r  s    r   get_tracer_providerz!LogfireConfig.get_tracer_provider  s     $$$r   c                    | j                   S )zGet 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
  r  s    r   get_meter_providerz LogfireConfig.get_meter_provider  s     ###r   c                `    | j                   s"| j                  st        | dt               y y y )Nz 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   rc   LogfireNotConfiguredWarning)r   messages     r   warn_if_not_initializedz%LogfireConfig.warn_if_not_initialized  s7      )>)>#) S T4 *? r   c                |    t         j                  |t        j                         | j                  j
                        S r   )rc  
from_tokenrf  rg  r   r   )r   r   s     r   r*  z0LogfireConfig._initialize_credentials_from_token  s*    !,,UH4D4D4FH^H^__r   c                    d fd}t        t        j                  j                               D ]B  }	 t	        |dd      }|s	  ||j                        |_         ||j                        |_        D y# t
        $ r Y Qw xY w# t
        $ rr}t        t
              5  t        |t              r|j                  dk(  s	 ddd       Y d}~	 ddd       n# 1 sw Y   nxY wddl}|j                  |       Y d}~d}~ww xY w)a  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                H     t        j                         d fd       }|S )Nc                     	 j                  d        | i |S # t        $ r dd l}|j                          Y 'w xY w)Ni  rH  r   )rR  r   	traceback	print_exc)argskwargsr  client_methodr   s      r   wrapperziLogfireConfig._ensure_flush_after_aws_lambda.<locals>.wrap_client_post_invocation_method.<locals>.wrapper  sK    *$$D$9 %d5f55 ! *$'')*s    ==)r  r   r  r   r  r   )	functoolswraps)r  r  r   s   ` r   "wrap_client_post_invocation_methodzXLogfireConfig._ensure_flush_after_aws_lambda.<locals>.wrap_client_post_invocation_method  s%    __]+6 ,6 Nr   LambdaRuntimeClientNr   )r  r   )r   r   modulesvaluesr  r   post_invocation_errorpost_invocation_resultr   r   typer|   r  print_exception)r   r  modclienter  s   `     r   rs  z,LogfireConfig._ensure_flush_after_aws_lambda  s    	& **,-C &;TB -/QRXRnRn/o,0RSYSpSp0q- .    -i( 'vt4La9a  )( :b )(( !))!,,-sG   A5.B5	B B	C?C:!C=C:	C:CC::C?c                h     | j                   j                  |   | j                  j                  |  y r   )r	  suppress_scopesr
  )r   scopess     r   r  zLogfireConfig.suppress_scopesC  s.    ---v6,,,f5r   )NNNNNNNNNNNNNNNNr   r  r  )i0u  )rI  r   r  rv   )r  rf   )r  r^   )r  r   )r   r   r  zLogfireCredentials | None)r  r   r  r  )r|   r}   r~   r  r   r  r  rR  r  r  r  r*  rs  r  r   r   r   r   r   ^  s    FJ #'&*"&:>"& $EI:>>B)-+/)-+/+/#6B6 6 !	6
 $6  6 86  6 6 %C6 86 <6 '6 )6 '6  )!6" )#6$ 
%6p'B' ' !	'
 $'  ' 8'  ' ' %C' 8' <' '' )' ''  )!'" )#'$ 
%'R
]2~
A%$`2-h6r   r   c                  >   e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 edd       Zedd       Zedd	       Zedd
       Z	edd       Z
edd       Zeddd	 	 	 	 	 	 	 	 	 	 	 dd       Zedddd	 	 	 	 	 	 	 	 	 	 	 dd       Ze	 	 	 	 	 	 dd       ZddZd dZy)!rc  zCredentials for logfire.dev.r   r   r   project_urlr'  c                   t        |      }|j                         r_	 |j                  d      5 }t        j                  |      }ddd       	 j                  dd      }||j                  d|        | di |S y# 1 sw Y   9xY w# t
        t        f$ r}t        d|       |d}~ww xY w# t        $ r}t        d| d|       |d}~ww xY w)aB  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   OSErrorr>   r   
setdefaultr   )cls	creds_dirpathfdatar  r  s          r   rd  z"LogfireCredentials.load_creds_file\  s     y);;=UYYt_99Q<D %
[ $$ ? ,OOM=A{T{" $_( U(+EdV)LMSTTU  [(+EdV3qc)RSYZZ[sF   B A<B -B. <BB B+B&&B+.	C7C		Cc                   	 |j                  t        |d      di t        d|i      }|j                  dk7  r:	 |j                         d   }t        j                  d	|j                   d
|        y|j                         } | ||d   |d   |      S # t        j                  $ r"}t        j                  d|        Y d}~yd}~ww xY w# t        $ r& t        j                  d	|j                   d       Y yw xY w)aH  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/info
   r1  )timeoutr6  zFLogfire API is unreachable, you may have trouble sending data. Error: NrG  detailz!Logfire API returned status code z
. Detail: z$, you may have trouble sending data.r   r  )r   r   r  r'  )
getr   COMMON_REQUEST_HEADERSrf  RequestExceptionr   r   status_coder  r   )r  r   r(  r   responser  r  r  s           r   r  zLogfireCredentials.from_tokenz  s   	{{*-J1J?EJ # H 3&	!2 78L8L7MZX^W_` }}n-]+$	
 	
% (( 	MMbcdbefg	  78L8L7MMqr s(   (B C C
(CC
,C<;C<c                    t        j                         r4t        t        t	        t                     }t        ||      r|d   |   d   S t        d      )Ntokensr   a
  You are not authenticated. Please run `logfire auth` to authenticate.

If you are running in production, you can set the `LOGFIRE_TOKEN` environment variable.
To create a write token, refer to https://logfire.pydantic.dev/docs/guides/advanced/creating_write_tokens/
)rF   is_filer   rG   rk   rH   r>   )r  r'  r  s      r   _get_user_tokenz"LogfireCredentials._get_user_token  sO    !^L%ABDD/2H~o6w?? 
 	
r   c                l    	 | j                  |      }| j                  |||      S # t        $ r Y y w xY w)Nr'  )r  r>   _get_user_for_token)r  r(  r'  
user_tokens       r   get_current_userz#LogfireCredentials.get_current_user  sE    	,,_,MJ &&z7OLL " 		s   ' 	33c                    i t         d|i}t        |d      }	 |j                  ||      }t        j                  |       |j                         S # t
        j                  $ r}t        d      |d }~ww xY w)Nr1  z/v1/account/mer6  z"Error retrieving user information.)	r  r   r  rh   raise_for_statusrf  r  r>   r  )r  r  r(  r'  r6  account_info_urlr  r  s           r   r  z&LogfireCredentials._get_user_for_token  s    I+I_jI"?4DE	R{{#3W{EH//9 }} (( 	R$%IJPQQ	Rs   (A A6%A11A6c                   | j                  |      }i t        d|i}t        |d      }	 |j                  ||      }t	        j
                  |       |j                         S # t        j                  $ r}t        d      |d}~ww xY w)aj  Get list of projects that user has access to them.

        Args:
            session: HTTP client session used to communicate with the Logfire API.
            logfire_api_url: The Logfire API base URL.

        Returns:
            List of user projects.

        Raises:
            LogfireConfigError: If there was an error retrieving user projects.
        r  r1  /v1/projects/r  z"Error retrieving list of projects.N)
r  r  r   r  rh   r  rf  r  r>   r  )r  r(  r'  r  r6  projects_urlr  r  s           r   get_user_projectsz$LogfireCredentials.get_user_projects  s     (((I
I+I_jI@	R{{<{AH//9 }} (( 	R$%IJPQQ	Rs   (A$ $B7BBN)organizationr   c                  | j                  |      }i t        d|i}d}d}	d}
|}t        t        j                        }|#|D cg c]  }|d   |k(  s| }}d| d	}d
| }	|d| d	}
|D cg c]  }|d   |k(  s| }}|t        |      dk(  r|d   d   }|d   d   }nw|sX|s|j                  d       yt        j                  d|
 d| dddgd      dk(  r|j                  d| d|	 d	       y|}d}d}n|||j                  d|
 d       d}d}||t        |      D ci c]  \  }}t        |dz         |d   |d   f }}}dj                  |j                         D cg c]  \  }}| d|d    d|d     c}}      }t        j                  d| dt        |j                               d      }||   }|d   }|d   }t        |d| d | d!      }	 |j!                  ||"      }t#        j$                  |       |j-                         S c c}w c c}w c c}}w c c}}w # t&        j(                  $ r}t+        d#      |d}~ww xY w)$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:
            session: HTTP client session used to communicate with the Logfire API.
            logfire_api_url: The Logfire API base URL.
            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  r1  r   projects)fileNorganization_namez in organization ``z --org zprojects with name `r   rE   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. /z7Please select one of the following projects by number:
1/v1/organizations/z
/projects/z/write-tokens/r  z#Error creating project write token.)r  r  r9   r   stderrlenprintr;   ask	enumerater   r   itemsr   r   r   postrh   r  rf  r  r>   r  )r  r(  r'  r  r  r   r  r6  org_messageorg_flagproject_messagefiltered_projectsr   pindexitemproject_choicesproject_choices_strselected_project_keyproject_info_tupleproject_write_token_urlr  r  s                          r   use_existing_projectz'LogfireCredentials.use_existing_project  s8   8 (((I
I+I_jI$$szz*#,4 _Hq:M8NR^8^H _.|nA>K /H# 4\N!DO,= c,=q>ARVbAb,= c#,=(>!(C,Q/0CDL,Q/?L"v 

/**Ek]Rmn #J
   <[MIdemdnnopq (LL 'L,@ /@BCLL<#7 $-->#?#?KE4 EAI&9!:D<P QQ#?   #'))DSDYDYD[\D[[UDE7"T!WIQtAwi0D[\# $*::JObNccef_1134$ 
 "11E!F-a0L-a0L") jnU#
	S||$;W|MH//9 }}K !` !dJ
 ]$ (( 	S$%JKQRR	Ss<   H"H"2H' H'0!H,2H2
*(H8 8IIIF)r  default_organizationr   c                  | j                  |      }i t        d|i}t        |d      }	 |j                  ||      }	t	        j
                  |	       |	j                         D cg c]  }|d   	 }}||vrt        |      dkD  r_| j                  |||      }|J |j                  d	i       j                  d      }|r|r|}nYt        j                  d
||r|n|d         }n9|d   }|s2t        j                  d| dd      }|st        j                   d       t#               }d}	 |xs t        j                  ||      }|rNt%        j&                  t(        |      s4t        j                  d|      }|rt%        j&                  t(        |      s4t        |d|       }	 |j+                  ||d|i      }	|	j,                  dk(  rd}d| d}d}|	j,                  dk(  r.|	j                         d   d   }|d   ddgk(  rd}d|d    d }d}t	        j
                  |	       |	j                         S # t        j                  $ r}
t        d      |
d}
~
ww xY wc c}w # t        j                  $ r}
t        d!      |
d}
~
ww xY w)"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:
            session: HTTP client session used to communicate with the Logfire API.
            logfire_api_url: The Logfire API base URL.
            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 informations.

        Raises:
            LogfireConfigError: If there was an error creating projects.
        r  r1  r  r  z'Error retrieving list of organizations.Nr  rE   r  z|
To create and use a new project, please provide the following information:
Select the organization to create the project inr   r  z1The project will be created in the organization "z". Continue?Tr  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:r  r   )r6  r  i  .z
A project with the name 'z7' already exists. Please enter a different project namei  r  locbodyz*
The project name you entered is invalid:
msgz&
Please enter a different project namezError creating new project.)r  r  r   r  rh   r  rf  r  r>   r  r  r  r;   r  r:   r   exitdefault_project_namerematchPROJECT_NAME_PATTERNr  r  )r  r(  r'  r  r  r   r  r6  organizations_urlr  r  r  organizationsuser_detailsuser_default_organization_nameconfirmproject_name_defaultproject_name_prompturlerrors                       r   create_new_projectz%LogfireCredentials.create_new_projectK  s   8 (((I
I+I_jI $O5IJ	W{{#4g{FH//9 @H}}Ot12O},=!A%"66z7O\#///1=1A1ABXZ\1]1a1abu1v.',J#AL#)::K -B` >fstufv	$L  -Q/+%kkKL>YefptG #+?+A6'h6::6ISg+hLrxx0Dl'S%zz>
 1  rxx0Dl'S /]<.+IJC'"<<WNT`Ca<b''3.+.(5l^ DA B ( $(L''3.$MMOH5a8EU|'??/2,J$U|n -DE ,
 (, "33H=  }}&K (( 	W$%NOUVV	WO@ ,, O()FGQNOsA   (H8 &I&/I$ <I$ I$ 8III$J7JJc               n   d}t        d       | j                  ||      }|r-t        j                  dd      }|r| j	                  |||      }|s| j                  ||      }	  | di |d|i}t        j                  d	|j                   d
       |S # t        $ r}t        d|       |d}~ww xY w)a  Create a new project or use an existing project on logfire.dev requesting the given project name.

        Args:
            logfire_api_url: The Logfire API base URL.
            session: HTTP client session used to communicate with the Logfire API.

        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.
)r(  r'  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   )
r  r  r:   r  r  r  r;   r  r   r>   )r  r'  r(  rz  r  use_existing_projectsresultr  s           r   re  z%LogfireCredentials.initialize_project  s    & .2L	

 ((/(Z$+KK0dnr$s!$!66#_x 7  00 / 1 K
	dH;HHFJJTU[UgUgTh i* * M 	d$'WXYWZ%[\bcc	ds   &0B 	B4 B//B4c                    t        |       t        j                  |       }t        |      }|j	                  t        j                  |d      dz          y)z+Write a credentials file to the given path.rB   )indentr  N)ri   r   asdictr  
write_textr  dumps)r   r  r  r  s       r   rh  z#LogfireCredentials.write_creds_file  s@    y)!!$'y)

42T9:r   c                    | j                   r<t        d| j                    d| j                    dt        | j                                yy)z(Print a summary of the existing project.z([bold]Logfire[/bold] project URL: [link=z cyan]z[/link])min_content_widthN)r  _print_summaryr  r  s    r   r+  z&LogfireCredentials.print_token_summary  sH    :4;K;K:LFSWScScRddkl"%d&6&6"7 r   )r  r   r  Self | None)r   r   r(  requests.Sessionr   r   r  r  )r'  r   r  r   )r(  r  r'  r   r  dict[str, Any] | None)r  r   r(  r  r'  r   r  dict[str, Any])r(  r  r'  r   r  list[dict[str, Any]])r(  r  r'  r   r  r  r  r   r   r   r  r  )r(  r  r'  r   r  r   r  rv   r   r   r  r  )r'  r   r(  r  r  r<   )r  r   r  r  r  )r|   r}   r~   r   r   classmethodrd  r  r  r  r  r  r  r  re  rh  r+  r   r   r   rc  rc  O  s   &J'""#[ [: '
 '
R 
 
 M M    .  $(#'k "k 	k
 'k !k !k 
k kZ  $(%*#'h' "h' 	h'
 !h' #h' !h' 
h' h'T /d /d "	/d
 
/d /db;r   rc  c                    ddl m} ddlm} ddlm}  |d |d      i      } |d|	      }|j                  |d
z   k  r
|d
z   |_        |j                  |        y )Nr   r8   )Style)Themezmarkdown.link_urlcyan)colorT)r  theme   )rich.consoler9   
rich.styler   
rich.themer!  widthr  )r  r  r9   r   r!  custom_themer   s          r   r  r    sX    $   -u6/BCDLT6G}}(1,,)A-MM'r   c                    | t         z  S )z%Get the path to the credentials file.)CREDENTIALS_FILENAME)r  s    r   r  r    s    +++r   c                     ddl } | j                  g d| j                        j                  d      j	                         S )z Get the current git commit hash.r   N)gitz	rev-parseHEAD)r  ascii)
subprocesscheck_outputSTDOUTdecoderZ  )r1  s    r   r   r   
  s7    ""#?
HYHY"Zaabijpprrr   c                Z    t        j                  dd|       j                         dd x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  subrl  )r0  s    r   sanitize_project_namer9    s,     66/2t,224Sb9GZGr   c                 v    t        t        j                  j                  t        j                                     S r   )r9  r   r  basenamer[  r   r   r   r   r     s"     !1!1"))+!>??r   c                      e Zd Zy)r  Nr   r   r   r   r  r    s    r   r  )&r   rv   r   r   r   r   r   r   r   r   r   r   r   r   r   Path | str | Noner   r=  r   r   r   r   r   r  r   r   r   r  r   r   r   r   r   r  r   zUnpack[DeprecatedKwargs]r  rm   )r   r   r  z
int | None)r  r   r  r   r  r  )r  r   r  r   )r  r   )r0  r   r  r   )
__future__r   _annotationsro  r   r  r  r   r  r   r   r   
contextlibr   r   r   pathlibr   	threadingr   r	   typingr
   r   r   r   r   r   r   urllib.parser   uuidr   rf  opentelemetryr   #opentelemetry.environment_variablesr   r   &opentelemetry.exporter.otlp.proto.httpr   6opentelemetry.exporter.otlp.proto.http.metric_exporterr   5opentelemetry.exporter.otlp.proto.http.trace_exporterr   opentelemetry.metricsr   r   opentelemetry.propagater   r   'opentelemetry.sdk.environment_variablesr   r   r   r    r!   opentelemetry.sdk.metricsr"   r#   r$   r%   r&   r'   r(    opentelemetry.sdk.metrics.exportr)   r*   r+   opentelemetry.sdk.metrics.viewr,   r-   opentelemetry.sdk.resourcesr.   opentelemetry.sdk.tracer/   r0   r1   r_  opentelemetry.sdk.trace.exportr2   r3   $opentelemetry.sdk.trace.id_generatorr4    opentelemetry.sdk.trace.samplingr5   r6   opentelemetry.semconv.resourcer7   r&  r9   rich.promptr:   r;   typing_extensionsr<   r=   logfire.exceptionsr>   logfire.samplingr?   logfire.sampling._tail_samplingr@   logfire.versionrA   	propagaterC   rD   authrF   rG   rH   config_paramsrI   rJ   	constantsrK   rL   rM   rN   rO   rP   rQ   exporters.consolerR   rS   rT   rU   exporters.otlprV   rW   exporters.processor_wrapperrX   rY   exporters.quiet_metricsrZ   exporters.remove_pendingr[   exporters.testr\   integrations.executorsr]   r   r^   r   r_   r`   ra   rb   
stack_inforc   tracerrd   re   rf   utilsrg   rh   ri   rj   rk   rl   mainrm   r,  r  r  DELTA
CUMULATIVErk  rq   r   r   r   r   r   r   r   r   r   r   rc  r  r  r   r9  r   UserWarningr  r   r   r   <module>ro     s   2     	 	 
    (  # S S S      [ > U R G J    q p V 0 u u R < M =   ' * 1 , A # \ 9 9 C    Q o 8 @ ( 8 ' N N / I I   2  +&(7)(<=  =4  #)))44%++-333>>+66!  P P P( F F F  9 9 9, s s s   0	y 	 AE#"&"6:$("&AE6::>%)'+%)'+'+%T(T( ?T( 	T(
 T(  T( T( 4T( "T(  T( !?T( 4T( 8T( #T( %T(  #!T(" %#T($ %%T(& 2'T(( )T(n \ \ \~g6& g6\  e e eP
,
sH@	+ 	r   