opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentati...
João Sampaio 20c1cb994b
When Flask activation is missing, do not emit a log message (#253)
If a Flask request doesn't have an active span, it just means that it
was initialized via a mechanism that doesn't run `before_request`, like
`app.test_request_context` or even manually. It is okay and
instrumentation still works.
2020-12-15 09:53:07 -08:00
..
src/opentelemetry/instrumentation/flask When Flask activation is missing, do not emit a log message (#253) 2020-12-15 09:53:07 -08:00
tests Rename "host.port" attribute to "net.host.port" (#242) 2020-12-11 07:55:11 -08:00
LICENSE Rename web framework packages from "ext" to "instrumentation" (#961) 2020-08-03 10:10:45 -07:00
MANIFEST.in Rename web framework packages from "ext" to "instrumentation" (#961) 2020-08-03 10:10:45 -07:00
README.rst Update package links to point to contrib repo 2020-11-18 13:09:44 -08:00
setup.cfg update version to 0.17.dev0 2020-11-25 21:10:39 -08:00
setup.py Rename web framework packages from "ext" to "instrumentation" (#961) 2020-08-03 10:10:45 -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``.

References
----------

* `OpenTelemetry Flask Instrumentation <https://opentelemetry-python-contrib.readthedocs.io/en/stable/instrumentation/flask/flask.html>`_
* `OpenTelemetry Project <https://opentelemetry.io/>`_