From 6e7ac6dcc955fb62d0f1a2c6537ca7cfe8e0024f Mon Sep 17 00:00:00 2001 From: Anthony Ricaud Date: Fri, 20 Jul 2012 19:47:35 +0200 Subject: [PATCH] Bug 775534 - Add statsd logging for requests. --- .gitmodules | 6 ++++++ requirements/prod.txt | 2 ++ settings/base.py | 3 +++ settings/local.py-dist | 5 +++++ vendor-local/src/django-statsd | 1 + vendor-local/src/pystatsd | 1 + vendor-local/vendor.pth | 2 ++ 7 files changed, 20 insertions(+) create mode 160000 vendor-local/src/django-statsd create mode 160000 vendor-local/src/pystatsd diff --git a/.gitmodules b/.gitmodules index b42091e262..87b9cf801b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,9 @@ [submodule "vendor-local/src/django-dnt"] path = vendor-local/src/django-dnt url = https://github.com/mozilla/django-dnt.git +[submodule "vendor-local/src/django-statsd"] + path = vendor-local/src/django-statsd + url = git://github.com/andymckay/django-statsd.git +[submodule "vendor-local/src/pystatsd"] + path = vendor-local/src/pystatsd + url = git://github.com/jsocol/pystatsd.git diff --git a/requirements/prod.txt b/requirements/prod.txt index e0ad16d80c..7de65af32c 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -27,3 +27,5 @@ Babel>=0.9.4 -e git://github.com/fwenzel/django-mozilla-product-details#egg=django-mozilla-product-details python-memcached==1.45 + +django-statsd-mozilla==0.3.5 \ No newline at end of file diff --git a/settings/base.py b/settings/base.py index 04d0704f69..b84b7aba35 100644 --- a/settings/base.py +++ b/settings/base.py @@ -352,6 +352,8 @@ PROD_DETAILS_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'lib/product_details_json') MIDDLEWARE_CLASSES = ( + 'django_statsd.middleware.GraphiteRequestTimingMiddleware', + 'django_statsd.middleware.GraphiteMiddleware', 'funfactory.middleware.LocaleURLMiddleware', #'multidb.middleware.PinningRouterMiddleware', 'django.middleware.common.CommonMiddleware', @@ -371,6 +373,7 @@ INSTALLED_APPS = ( 'funfactory', # Content common to most playdoh-based apps. 'jingo_minify', 'tower', # for ./manage.py extract (L10n) + 'django_statsd', # Django contrib apps 'django.contrib.auth', diff --git a/settings/local.py-dist b/settings/local.py-dist index 506b72cbe6..f298a7ca54 100644 --- a/settings/local.py-dist +++ b/settings/local.py-dist @@ -26,3 +26,8 @@ EMAIL_HOST_PASSWORD = '' EMAIL_HOST = '' EMAIL_PORT = 25 EMAIL_USE_TLS = False + +STATSD_HOST = '' +STATSD_PORT = 8125 +STATSD_PREFIX = 'bedrock' +STATSD_CLIENT = 'django_statsd.clients.normal' \ No newline at end of file diff --git a/vendor-local/src/django-statsd b/vendor-local/src/django-statsd new file mode 160000 index 0000000000..d77e1c60ae --- /dev/null +++ b/vendor-local/src/django-statsd @@ -0,0 +1 @@ +Subproject commit d77e1c60ae07d9a253e084f11969c2803f1800d3 diff --git a/vendor-local/src/pystatsd b/vendor-local/src/pystatsd new file mode 160000 index 0000000000..3e78169def --- /dev/null +++ b/vendor-local/src/pystatsd @@ -0,0 +1 @@ +Subproject commit 3e78169def352792ace04317096208fb782fc348 diff --git a/vendor-local/vendor.pth b/vendor-local/vendor.pth index 0d7639f6df..be4f41f1b1 100644 --- a/vendor-local/vendor.pth +++ b/vendor-local/vendor.pth @@ -4,6 +4,8 @@ src/basket-client src/feedparser/feedparser src/django-recaptcha src/django-dnt +src/django-statsd +src/pystatsd packages/requests packages/certifi packages/chardet