Skip to main content

Django tool for instrumenting

Project description

Instrumenting

install

  • install with your favorite Python package manager
pip3 install shopcloud-django-instrumenting

LogRequestMiddleware

add additional Information from request in AppEngine to Log

usage

add to MIDDLEWARE in django-app settings.py:

MIDDLEWARE = [
    ...
    'shopcloud_django_instrumenting.middleware.LogRequestMiddleware',
]

tracing

from shopcloud_django_instrumenting import tracing

tr = tracing.Tracer('name_of_service', 'name_of_operation')
with tr.start_span('event.processing') as span:
    pass

data = tr.close()

deploy

$ rm -rf build dist
$ pip3 install wheel twine
$ python3 setup.py sdist bdist_wheel
$ twine upload dist/*

develop

$ pytest
$ pip3 install coverage
# shell report
$ coverage run -m pytest  && coverage report --show-missing
# html report
$ coverage run -m pytest  && coverage html
$ cd htmlcov
$ python3 -m http.server

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

shopcloud_django_instrumenting-1.3.0.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page