Metadata-Version: 2.4
Name: opentelemetry-instrumentation-niquests
Version: 0.1.0
Summary: OpenTelemetry niquests instrumentation
Project-URL: Homepage, https://github.com/abonur/opentelemetry-instrumentation-niquests
Project-URL: Repository, https://github.com/abonur/opentelemetry-instrumentation-niquests
Project-URL: Issues, https://github.com/abonur/opentelemetry-instrumentation-niquests/issues
Author-email: OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io>
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Requires-Dist: opentelemetry-api~=1.12
Requires-Dist: opentelemetry-instrumentation>=0.63b1
Requires-Dist: opentelemetry-semantic-conventions>=0.63b1
Requires-Dist: opentelemetry-util-http>=0.63b1
Provides-Extra: instruments
Requires-Dist: niquests<4,>=3.0; extra == 'instruments'
Description-Content-Type: text/x-rst

OpenTelemetry Niquests Instrumentation
======================================

|pypi|

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

This library allows tracing HTTP requests made by the
`niquests <https://niquests.readthedocs.io/>`_ library.

Niquests is a drop-in replacement for the ``requests`` library with
native async support, HTTP/2, and HTTP/3 capabilities. Both synchronous
and asynchronous interfaces are instrumented.

Lazy responses (e.g. ``Session(multiplexed=True)``) receive a span and
connection-level attributes (IP, TLS) but **status code and response headers
are not captured** because they are not yet available.

.. note::

   This is an independent, community-maintained package. It deliberately
   mirrors the ``opentelemetry-python-contrib`` package layout (import path and
   entry point) so that, should an equivalent instrumentation ever be adopted
   upstream, switching over is straightforward.

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

::

     pip install opentelemetry-instrumentation-niquests

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

Exclude lists
*************
To exclude certain URLs from being tracked, set the environment variable ``OTEL_PYTHON_NIQUESTS_EXCLUDED_URLS``
(or ``OTEL_PYTHON_EXCLUDED_URLS`` as fallback) with comma delimited regexes representing which URLs to exclude.

For example,

::

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

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

References
----------

* `Niquests <https://niquests.readthedocs.io/>`_
* `OpenTelemetry Project <https://opentelemetry.io/>`_
* `OpenTelemetry Python Examples <https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/examples>`_
