service tracing using jaeger in django project
Project description
# 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
```python
MIDDLEWARE = [
'huipy.tracer.middleware.TraceMiddleware',
# 其他中间件
'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
```python
from tracer.httpclient import HttpClient
HttpClient(url='http://httpbin.org/get').get()
```
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
```python
MIDDLEWARE = [
'huipy.tracer.middleware.TraceMiddleware',
# 其他中间件
'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
```python
from tracer.httpclient import HttpClient
HttpClient(url='http://httpbin.org/get').get()
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jaeger-django-1.0.1.tar.gz
(8.2 kB
view hashes)
Built Distribution
Close
Hashes for jaeger_django-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b7138d59897aa2d59d59a501300209e7ee89167ecd52d98f9e1505971744031 |
|
MD5 | 2f183f14db0b6920a5e946ed43576e6a |
|
BLAKE2b-256 | db7b4c2a7128e8c2b63d3b0cf6a62d93005e7d508b8c47db9e7e25c91b1bd31c |