Skip to content

Latest commit

 

History

History
32 lines (29 loc) · 973 Bytes

README.md

File metadata and controls

32 lines (29 loc) · 973 Bytes

jaeger-django

This python package can be used in django project to tracing service with jaeger. Enjoy!

Install

pip install jaeger-django

Usage

  • 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()