Skip to main content

Django tool for instrumenting

Project description

Instrumenting

install

  • install with your favorite Python package manager
pip3 install shopcloud-django-instrumenting
  • Add 'shopcloud-django-instrumenting' to your INSTALLED_APPS setting:
INSTALLED_APPS = (
    # other apps
    "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.1.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file shopcloud_django_instrumenting-1.1.2.tar.gz.

File metadata

File hashes

Hashes for shopcloud_django_instrumenting-1.1.2.tar.gz
Algorithm Hash digest
SHA256 729b5776b7f0930daff4da0a6faea08ef69c2e88a1ac252d525822657bd38344
MD5 c2cdbfd4ab6f583807308f8ee58fea91
BLAKE2b-256 55772867d3111807e7ef1e9556a212009a3b62aff13dce3c958d394dc4dfa321

See more details on using hashes here.

File details

Details for the file shopcloud_django_instrumenting-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for shopcloud_django_instrumenting-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e550b76dc08cff472d45a944596c465366ffe132617233c0c709c20d5d2b91ac
MD5 a41295904e3d9cf1f1cbc1eeae90ee6d
BLAKE2b-256 038215112fac1c92234e82f2893b611e00592e84d003cab869538f6b8801dff4

See more details on using hashes here.

Supported by

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