Pre-release
This release is a pre-release and may not be stable for production use.
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)
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.
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)
from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware
app = ... # An ASGI application.
app = OpenTelemetryMiddleware(app)
References
Metadata
Release files for opentelemetry-util-http 0.55b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| opentelemetry_util_http-0.55b1.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opentelemetry_util_http-0.55b1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.3 kB
Release files / opentelemetry_util_http-0.55b1.tar.gz
| Download URL | opentelemetry_util_http-0.55b1.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29e119c1f6796cccf5fc2aedb55274435cde5976d0ac3fec3ca20a80118f821e
|
|
BLAKE2b-256 checksum How to use checksums |
12f73cc23b95921177cdda6d61d3475659b86bac335ed02dd19f994a850ceee3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Release files / opentelemetry_util_http-0.55b1-py3-none-any.whl
| Download URL | opentelemetry_util_http-0.55b1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e134218df8ff010e111466650e5f019496b29c3b4f1b7de0e8ff8ebeafeebdf4
|
|
BLAKE2b-256 checksum How to use checksums |
a30a49c5464efc0e6f6aa94a9ec054879efe2a59d7c1f6aacc500665b3d8afdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|