o
    Á¿i\  ã                   @   s   d Z ddlmZ dgZdS )að  
The Cherrypy trace middleware will track request timings.
It uses the cherrypy hooks and creates a tool to track requests and errors


Usage
~~~~~
To install the middleware, add::

    from ddtrace.trace import tracer
    from ddtrace.contrib.cherrypy import TraceMiddleware

and create a `TraceMiddleware` object::

    traced_app = TraceMiddleware(cherrypy, service="my-cherrypy-app")


Configuration
~~~~~~~~~~~~~

.. py:data:: ddtrace.config.cherrypy['distributed_tracing']

   Whether to parse distributed tracing headers from requests received by your CherryPy app.

   Can also be enabled with the ``DD_CHERRYPY_DISTRIBUTED_TRACING`` environment variable.

   Default: ``True``

.. py:data:: ddtrace.config.cherrypy['service']

   The service name reported for your CherryPy app.

   Can also be configured via the ``DD_SERVICE`` environment variable.

   Default: ``'cherrypy'``


Example::
Here is the end result, in a sample app::

    import cherrypy

    from ddtrace.contrib.cherrypy import TraceMiddleware
    TraceMiddleware(cherrypy, service="my-cherrypy-app")

    @cherrypy.tools.tracer()
    class HelloWorld(object):
        def index(self):
            return "Hello World"
        index.exposed = True

    cherrypy.quickstart(HelloWorld())
é    )ÚTraceMiddlewarer   N)Ú__doc__Ú'ddtrace.contrib.internal.cherrypy.patchr   Ú__all__© r   r   úL/home/ubuntu/.local/lib/python3.10/site-packages/ddtrace/contrib/cherrypy.pyÚ<module>   s    6
