Django opentracing middleware works with k8s and istio
Project description
Django-istio-opentracing
Django opentracing middleware works with k8s and istio
install:
pip install django-istio-opentracing
example:
Add a middleware to your Django middleware.
MIDDLEWARE += [
'django_istio_opentracing.middleware.Middleware'
]
And if you using requests,
jusing using the patch in maybe your __init__.py
file.
Hint: make sure the patch line before your code.
from django_istio_opentracing import monkey
monkey.patch_requests()
Then use requests whatever you want, every request you make will carry the b3 code in header without extra coding.
Also you can use it directly in view:
from django_istio_opentracing import get_opentracing_span_headers
def index(request):
print(get_opentracing_span_headers())
return HttpResponse('ok')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django_istio_opentracing-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e444ba8757bbf4d82f0dd56a6221f4cd4eb8f1e18b1d9d8fcfe406def29c5b1e |
|
MD5 | 6dbdfe8a8e36ca6db588427a14417fbb |
|
BLAKE2b-256 | 8bc64e48250c639b5508e047a2e65e53326d83adb51ca95f70e1e59095524fd4 |