
    g                         d dl mZmZ d dlmZ d dlmZmZmZ d dl	m
Z
mZmZ d dlmZ d dlmZ d dlmZ d dlmZ  ee      Zdd
Zy	)    )	REMAINDERArgumentParser)	getLogger)environexeclgetcwd)abspathdirnamepathsep)sub)which)__version__)entry_pointsNc                     t        dd      } i }t        d      D ]j  }|j                         }t        |      D ]J  }|j	                  d      st        dd|      j                         }| j                  d	| d
       |||<   L l | j                  ddddt        z          | j                  dd       | j                  ddt               | j                         }|j                         D ]  \  }}t        ||      }||t        |<    t        j                  d      }	|	sg }	n|	j                  t               }	t#               }
|
|	vr|	j%                  d|
       t'        t)        t*                    }|	D cg c]
  }||k7  s	| }	}|	j%                  d|       t!        j,                  |	      t        d<   t/        |j0                        }t3        ||g|j4                    y c c}w )Nz
        opentelemetry-instrument automatically instruments a Python
        program and its dependencies and then runs the program.
        a  
        Optional arguments (except for --help and --version) for opentelemetry-instrument
        directly correspond with OpenTelemetry environment variables. The
        corresponding optional argument is formed by removing the OTEL_ or
        OTEL_PYTHON_ prefix from the environment variable and lower casing the
        rest. For example, the optional argument --attribute_value_length_limit
        corresponds with the environment variable
        OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT.

        These optional arguments will override the current value of the
        corresponding environment variable during the execution of the command.
        )descriptionepilog#opentelemetry_environment_variables)groupOTEL_zOTEL_(PYTHON_)? z--F)requiredz	--versionzprint version informationversionz	%(prog)s )helpactionr   commandzYour Python application.)r   command_argszArguments for your application.)r   nargs
PYTHONPATHr   )r   r   loaddir
startswithr   loweradd_argumentr   r   
parse_argsitemsgetattrr   getsplitr   r   insertr
   r	   __file__joinr   r   r   r   )parser"argument_otel_environment_variableentry_pointenvironment_variable_module	attributeargumentargsotel_environment_variablevaluepython_pathcwd_pathfiledir_pathpath
executables                 p/var/www/openai/venv/lib/python3.12/site-packages/opentelemetry/instrumentation/auto_instrumentation/__init__.pyrunr;      s   F& *,&#3 '2&6&6&8#89I##G,12yAGGI##
O" $  @I28< : (k)	   	(BC
.   D 	+eg0++ h'16G-.0 ++l+K "''0xH
 {"1h'78,-L$/HKD4<3G4KKHq,'#LL5GLt||$J	*j54#4#45 Is   ;
G'G')returnN)argparser   r   loggingr   osr   r   r   os.pathr	   r
   r   rer   shutilr   %opentelemetry.instrumentation.versionr   &opentelemetry.util._importlib_metadatar   __name___loggerr;        r:   <module>rI      s5    /  % % - -   = ?
H
T6rH   