Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pypi

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

Release files for opentelemetry-util-http 0.65b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opentelemetry-util-http 0.65b0
File Size Uploaded
opentelemetry_util_http-0.65b0.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opentelemetry-util-http 0.65b0
File Interpreter ABI Platform
opentelemetry_util_http-0.65b0-py3-none-any.whl Python 3 none any Details

Total release size: 19.5 kB

Release files / opentelemetry_util_http-0.65b0.tar.gz

Download URL opentelemetry_util_http-0.65b0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
84f82d826978bba416ab453460ff6a7391cdc3534c93a786595e4068680016b7
BLAKE2b-256 checksum
How to use checksums
32a9d7525a59fdd240e69b5af4a6338e78fafa1b4203394122cbd6701fb5f84a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / opentelemetry_util_http-0.65b0-py3-none-any.whl

Download URL opentelemetry_util_http-0.65b0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7553b606f963097cb190536dc30556cce85090692e471a422fff30ca29b04348
BLAKE2b-256 checksum
How to use checksums
233fab8d29df207ce5f470a07fa96ebb48af4e95b7fab7e7635311b9a32f2fab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release history Release notifications | RSS feed

This release

0.65b0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page