Skip to main content

opentracing python SDK

0. TODO

django-opentracing-logger is a django opentracing SDK based on logger which focus on ease to use. This project mainly works now, but we need to do a little work to let it works with official opentracing since it was built for a dialect of opentracing schema(90% of the schema were the same).

1. install

# current 0.0.1
pip install django-opentracing-logger

2. config opentracing logger

# settings.py
from django_opentracing_logger.opentracing.tracer import set_log_tracer

# add request middleware
MIDDLEWARE = [
    'django_opentracing_logger.opentracing.middleware.DDTracerMiddleware',
]

# add logger
LOGGING = {
    'filters': {
        'trace_id': {
            '()': 'django_opentracing_logger.opentracing.logging.TraceIDFilter',
        }
    },
    'formatters': {
        # ...,
        'trace': {
            '()': 'pythonjsonlogger.jsonlogger.JsonFormatter',
            'fmt': '%(message)s',
        }
    },
    'handlers': {
        # ...,
        'trace': {
            'level': 'INFO',
            'class': 'django_opentracing_logger.opentracing.logging.TraceHandler',
            'filename': '%s/trace.log' % '/data/logs/trace',
            'backupCount': 10,
            'when': 'D',
            'interval': 1,
            'formatter': 'trace'
        }
    },
    'loggers': {
        'tracer': {'handlers': ['trace'], 'propagate': True, 'level': 'DEBUG'},
    }
}

# init tracer
APM_ENABLE = True
if APM_ENABLE:
    set_log_tracer("PROJECT_NAME") # TODO replace PROJECT_NAME with your real project name

3. collect

collect logs in /data/logs/trace

4. view

use any viewer which Compatible with opentracing.

Metadata

Release files for django-opentracing-logger 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-opentracing-logger 0.0.2
File Size Uploaded Provenance Actions
django-opentracing-logger-0.0.2.tar.gz 11.0 kB Without provenance Details for django-opentracing-logger-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-opentracing-logger 0.0.2
File Interpreter ABI Platform Actions
django_opentracing_logger-0.0.2-py3-none-any.whl Python 3 none any Details for django_opentracing_logger-0.0.2-py3-none-any.whl

Total release size: 24.3 kB

Release files / django-opentracing-logger-0.0.2.tar.gz

Download URL django-opentracing-logger-0.0.2.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3f72e1ef7beed49c2fd45f14652de07b3a0e37a4113f80f9656a137d06ffd5bd
BLAKE2b-256 checksum
How to use checksums
56899cf8d1e92469d9d2318b7f23ce631f913417a07b85a9bc7617f180aae429
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.31.0 CPython/3.7.6

Release files / django_opentracing_logger-0.0.2-py3-none-any.whl

Download URL django_opentracing_logger-0.0.2-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e049258db1105d0cb6847ac2be4c96c3a33246107da5ba533f3cb877378a8c8f
BLAKE2b-256 checksum
How to use checksums
d4a8294415353ad72081148c2845544e1f13246607edfe34dd9a3c8ac4999080
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.31.0 CPython/3.7.6

Security for django-opentracing-logger 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page