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-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45ff60b6c7706794fb290fb055681ca80b43b3b1bfbcb668b721363767d38351 |
|
MD5 | b6de8ede262f22914709d1cfb1fc4f47 |
|
BLAKE2b-256 | 89bc98b444a84b7ebedb4abd00ad9c6bdf126001dc44b09a2fb0e1c559573088 |