opentelemetry-util-http


Nameopentelemetry-util-http JSON
Version 0.49b2 PyPI version JSON
download
home_pageNone
SummaryWeb util for OpenTelemetry
upload_time2024-11-18 18:40:32
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            OpenTelemetry Util HTTP
=======================

|pypi|

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


This library provides ASGI, WSGI middleware and other HTTP-related
functionality that is common to instrumented web frameworks (such as Django,
Starlette, FastAPI, etc.) to track requests timing through OpenTelemetry.

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

::

    pip install opentelemetry-util-http


Usage (Quart)
-------------

.. code-block:: python

    from quart import Quart
    from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware

    app = Quart(__name__)
    app.asgi_app = OpenTelemetryMiddleware(app.asgi_app)

    @app.route("/")
    async def hello():
        return "Hello!"

    if __name__ == "__main__":
        app.run(debug=True)


Usage (Django 3.0)
------------------

Modify the application's ``asgi.py`` file as shown below.

.. code-block:: python

    import os
    from django.core.asgi import get_asgi_application
    from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware

    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'asgi_example.settings')

    application = get_asgi_application()
    application = OpenTelemetryMiddleware(application)


Usage (Raw ASGI)
----------------

.. code-block:: python

    from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware

    app = ...  # An ASGI application.
    app = OpenTelemetryMiddleware(app)


References
----------

* `OpenTelemetry Project <https://opentelemetry.io/>`_

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "opentelemetry-util-http",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io>",
    "download_url": "https://files.pythonhosted.org/packages/96/28/ac5b1a0fd210ecb6c86c5e04256ba09c8308eb41e116097b9e2714d4b8dd/opentelemetry_util_http-0.49b2.tar.gz",
    "platform": null,
    "description": "OpenTelemetry Util HTTP\n=======================\n\n|pypi|\n\n.. |pypi| image:: https://badge.fury.io/py/opentelemetry-util-http.svg\n   :target: https://pypi.org/project/opentelemetry-util-http/\n\n\nThis library provides ASGI, WSGI middleware and other HTTP-related\nfunctionality that is common to instrumented web frameworks (such as Django,\nStarlette, FastAPI, etc.) to track requests timing through OpenTelemetry.\n\nInstallation\n------------\n\n::\n\n    pip install opentelemetry-util-http\n\n\nUsage (Quart)\n-------------\n\n.. code-block:: python\n\n    from quart import Quart\n    from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware\n\n    app = Quart(__name__)\n    app.asgi_app = OpenTelemetryMiddleware(app.asgi_app)\n\n    @app.route(\"/\")\n    async def hello():\n        return \"Hello!\"\n\n    if __name__ == \"__main__\":\n        app.run(debug=True)\n\n\nUsage (Django 3.0)\n------------------\n\nModify the application's ``asgi.py`` file as shown below.\n\n.. code-block:: python\n\n    import os\n    from django.core.asgi import get_asgi_application\n    from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware\n\n    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'asgi_example.settings')\n\n    application = get_asgi_application()\n    application = OpenTelemetryMiddleware(application)\n\n\nUsage (Raw ASGI)\n----------------\n\n.. code-block:: python\n\n    from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware\n\n    app = ...  # An ASGI application.\n    app = OpenTelemetryMiddleware(app)\n\n\nReferences\n----------\n\n* `OpenTelemetry Project <https://opentelemetry.io/>`_\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Web util for OpenTelemetry",
    "version": "0.49b2",
    "project_urls": {
        "Homepage": "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/util/opentelemetry-util-http"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "19229128f10d1c2868ee42df7e10937d00f154a69bee87c416ca9b20a6af6c54",
                "md5": "59436af70102b8294b89d7363f91ed57",
                "sha256": "e325d6511c6bee7b43170eb0c93261a210ec57e20ab1d7a99838515ef6d2bf58"
            },
            "downloads": -1,
            "filename": "opentelemetry_util_http-0.49b2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "59436af70102b8294b89d7363f91ed57",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6941,
            "upload_time": "2024-11-18T18:39:40",
            "upload_time_iso_8601": "2024-11-18T18:39:40.201937Z",
            "url": "https://files.pythonhosted.org/packages/19/22/9128f10d1c2868ee42df7e10937d00f154a69bee87c416ca9b20a6af6c54/opentelemetry_util_http-0.49b2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9628ac5b1a0fd210ecb6c86c5e04256ba09c8308eb41e116097b9e2714d4b8dd",
                "md5": "08c3661ca33ea71ee327dd811a9ffa5c",
                "sha256": "5958c7009f79146bbe98b0fdb23d9d7bf1ea9cd154a1c199029b1a89e0557199"
            },
            "downloads": -1,
            "filename": "opentelemetry_util_http-0.49b2.tar.gz",
            "has_sig": false,
            "md5_digest": "08c3661ca33ea71ee327dd811a9ffa5c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7861,
            "upload_time": "2024-11-18T18:40:32",
            "upload_time_iso_8601": "2024-11-18T18:40:32.804526Z",
            "url": "https://files.pythonhosted.org/packages/96/28/ac5b1a0fd210ecb6c86c5e04256ba09c8308eb41e116097b9e2714d4b8dd/opentelemetry_util_http-0.49b2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-18 18:40:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "open-telemetry",
    "github_project": "opentelemetry-python-contrib",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "opentelemetry-util-http"
}
        
Elapsed time: 0.40389s