opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentati...
Leighton Chen 3f72b32a9b version 2021-02-19 12:14:12 -08:00
..
src/opentelemetry/instrumentation/tornado lint 2021-02-19 09:57:51 -08:00
tests Remove Configuration from instrumentations (#285) 2021-02-04 08:02:37 -08:00
LICENSE Added instrumentation for Tornado 6 and above (#1018) 2020-09-17 07:19:27 -07:00
MANIFEST.in Added instrumentation for Tornado 6 and above (#1018) 2020-09-17 07:19:27 -07:00
README.rst Update package links to point to contrib repo 2020-11-18 13:09:44 -08:00
setup.cfg version 2021-02-19 12:14:12 -08:00
setup.py Added instrumentation for Tornado 6 and above (#1018) 2020-09-17 07:19:27 -07:00

README.rst

OpenTelemetry Tornado Instrumentation
======================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-tornado.svg
   :target: https://pypi.org/project/opentelemetry-instrumentation-tornado/

This library builds on the OpenTelemetry WSGI middleware to track web requests
in Tornado applications.

Installation
------------

::

    pip install opentelemetry-instrumentation-tornado

Configuration
-------------

The following environment variables are supported as configuration options:

- OTEL_PYTHON_TORNADO_EXCLUDED_URLS 

A comma separated list of paths that should not be automatically traced. For example, if this is set to 

::

    export OTEL_PYTHON_TORNADO_EXLUDED_URLS='/healthz,/ping'

Then any requests made to ``/healthz`` and ``/ping`` will not be automatically traced.

Request attributes
********************
To extract certain attributes from Tornado's request object and use them as span attributes, set the environment variable ``OTEL_PYTHON_TORNADO_TRACED_REQUEST_ATTRS`` to a comma
delimited list of request attribute names. 

For example,

::

    export OTEL_PYTHON_TORNADO_TRACED_REQUEST_ATTRS='uri,query'

will extract path_info and content_type attributes from every traced request and add them as span attributes.

References
----------

* `OpenTelemetry Tornado Instrumentation <https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/tornado/tornado.html>`_
* `OpenTelemetry Project <https://opentelemetry.io/>`_