This python package can be used in django project to tracing service with jaeger. Enjoy!
pip install jaeger-django
-
Using middleware for inbound request settings.py in django
MIDDLEWARE = [ 'jaegertrace.middleware.TraceMiddleware', # other middleware 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] # service name SERVICE_NAME = 'service name' # other conf ...
-
Using httpclient for outbound request
from jaegertrace.httpclient import HttpClient HttpClient(url='http://httpbin.org/get').get()