opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentati...
Owais Lone d4668bcbc7
Release/1.5.0 0.24b0 (#628)
* updating changelogs and version to 1.4.0-0.24.dev0

* updating changelogs and version to 1.5.0-0.24b0

* Update CHANGELOG.md

Co-authored-by: Leighton Chen <lechen@microsoft.com>

* Update CHANGELOG.md

Co-authored-by: Leighton Chen <lechen@microsoft.com>

Co-authored-by: Leighton Chen <lechen@microsoft.com>
2021-08-26 14:54:46 +05:30
..
src/opentelemetry/instrumentation/flask Release/1.5.0 0.24b0 (#628) 2021-08-26 14:54:46 +05:30
tests Provide excluded_urls argument to Flask instrumentation (#604) 2021-07-29 13:22:28 -07:00
LICENSE Fix error in license files (#521) 2021-05-28 09:16:58 -07:00
MANIFEST.in Rename web framework packages from "ext" to "instrumentation" (#961) 2020-08-03 10:10:45 -07:00
README.rst Provide excluded_urls argument to Flask instrumentation (#604) 2021-07-29 13:22:28 -07:00
setup.cfg Release/1.5.0 0.24b0 (#628) 2021-08-26 14:54:46 +05:30
setup.py Simplify bootstrap and generate code (#514) 2021-06-01 09:19:09 -07:00

README.rst

OpenTelemetry Flask Tracing
===========================

|pypi|

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

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

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

::

    pip install opentelemetry-instrumentation-flask

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

Exclude lists
*************
To exclude certain URLs from being tracked, set the environment variable ``OTEL_PYTHON_FLASK_EXCLUDED_URLS`` with comma delimited regexes representing which URLs to exclude.

For example,

::

    export OTEL_PYTHON_FLASK_EXCLUDED_URLS="client/.*/info,healthcheck"

will exclude requests such as ``https://site/client/123/info`` and ``https://site/xyz/healthcheck``.

You can also pass the comma delimited regexes to the ``instrument_app`` method directly:

.. code-block:: python

    FlaskInstrumentor().instrument_app(app, excluded_urls="client/.*/info,healthcheck")

References
----------

* `OpenTelemetry Flask Instrumentation <https://opentelemetry-python-contrib.readthedocs.io/en/stable/instrumentation/flask/flask.html>`_
* `OpenTelemetry Project <https://opentelemetry.io/>`_
* `OpenTelemetry Python Examples <https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/examples>`_