Registry / devops / django-statsd-mozilla

django-statsd-mozilla

JSON →
library0.4.0pypypiunverified

Django interface with statsd, providing middleware, backends, and template tags for sending metrics to statsd. Current version 0.4.0. Low release cadence, last updated 2019.

pip install django-statsd-mozilla
INSTALL
IMPORT
SIG · DJANGO-STATSD-MOZI
D
django-statsd-mozilla
devopspythonv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

StatsdMiddleware
from django_statsd.middleware import StatsdMiddleware
from django_statsd.middleware import StatsdMiddleware

Minimal setup for statsd integration in Django.

INSTALLED_APPS = [ 'django_statsd', ] MIDDLEWARE = [ 'django_statsd.middleware.StatsdMiddleware', ] STATSD_CLIENT = 'django_statsd.clients.normal' STATSD_HOST = os.environ.get('STATSD_HOST', 'localhost') STATSD_PORT = int(os.environ.get('STATSD_PORT', 8125)) # In view or template from django_statsd.clients import statsd statsd.incr('my.metric')
Debug
Known issues
gotchaThe package name on PyPI is 'django-statsd-mozilla', but the Python module is 'django_statsd'. Do not use 'statsd' or 'djangostatsd'.
fix
Use `import django_statsd` or `from django_statsd.clients import statsd`.
affects: all
deprecatedThe 'graphite' statsd client has been removed from recent versions.
fix
Use 'django_statsd.clients.normal' or 'django_statsd.clients.statful' instead.
affects: 0.4.0
gotchaMiddleware must be placed before CommonMiddleware to get request timing accurately.
fix
Ensure `StatsdMiddleware` appears before `django.middleware.common.CommonMiddleware` in MIDDLEWARE setting.
affects: all
Upgrade
Version history
0.4.0latest on PyPI · released Sep 1, 2017
Audit
Dependencies
statsdrequiredRequired for connecting to statsd daemon
djangorequiredDjango framework
Agent activity
13 hits · last 30 days
node
12
Resources
django-statsd-mozilla — pip install django-statsd-mozilla · libregistry