3
Z_ð]l  ã               @   s^   d dl mZ d dl mZ d dl mZ d dl mZ d dl mZ d dlmZ ddd„Zdd„ Z	dS )é    )Úhttp)Úwsgi)Úgreenthread)Úlog)Úapi)ÚZipkinClientú	127.0.0.1éÂ$  Fç      ð?c             C   s6   t | |ƒt_tj|ƒ tjƒ  tjƒ  |r2tjƒ  dS )aŽ   Apply monkey patch to trace your WSGI application.

    :param host: Scribe daemon IP address (default: '127.0.0.1')
    :param port: Scribe daemon port (default: 9410)
    :param trace_app_log: A Boolean indicating if the tracer will trace
        application log together or not. This facility assume that
        your application uses python standard logging library.
        (default: False)
    :param sampling_rate: A Float value (0.0~1.0) that indicates
        the tracing frequency. If you specify 1.0, all request
        are traced (and sent to Zipkin collecotr).
        If you specify 0.1, only 1/10 requests are traced. (default: 1.0)
    N)r   r   Úclientr   Úpatchr   r   r   )ÚhostÚportZtrace_app_logZsampling_rate© r   ú;/tmp/pip-build-yz_zf6az/eventlet/eventlet/zipkin/patcher.pyÚenable_trace_patch	   s    
r   c               C   s.   t jƒ  tjƒ  tjƒ  tjƒ  tjjƒ  d S )N)r   Zunpatchr   r   r   r   r   Úcloser   r   r   r   Údisable_trace_patch$   s
    r   N)r   r	   Fr
   )
Zeventlet.zipkinr   r   r   r   r   Zeventlet.zipkin.clientr   r   r   r   r   r   r   Ú<module>   s    
