Merge lp:~lifeless/python-oops-tools/timeline into lp:python-oops-tools

Proposed by Robert Collins
Status: Merged
Approved by: Robert Collins
Approved revision: 46
Merged at revision: 43
Proposed branch: lp:~lifeless/python-oops-tools/timeline
Merge into: lp:python-oops-tools
Diff against target: 135 lines (+30/-3)
6 files modified
buildout-templates/bin/oopstools.wsgi.in (+14/-1)
buildout-templates/src/oopstools/settings.py.in (+1/-0)
buildout.cfg (+0/-1)
setup.py (+4/-0)
src/oopstools/NEWS.txt (+6/-0)
versions.cfg (+5/-1)
To merge this branch: bzr merge lp:~lifeless/python-oops-tools/timeline
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+125086@code.launchpad.net

Commit message

Django 1.3.3, new djangorecipe, and start capturing SQL activity in OOPSes raised by oops-tools itself.

Description of the change

Upgrade oops-tools infrastructure a bit, get latest django in the 1.3 series - 1.3.3, and then on top of that introduce timeline-django so we can capture the SQL calls being made when oops-tools itself has an issue.

This also provides a bit of a reference-use-case for using django-timeline.

We may find we need to implement tighter query filtering - I don't know whether the django-sso-auth stuff will be caught properly, so we may end up deploying, getting a couple of traces, and then disabling in prod.

To post a comment you must log in.
44. By Robert Collins

Add missed timeline_django dep.

Revision history for this message
William Grant (wgrant) wrote :

I'm a little reluctant to switch SQL logging on by default, but otherwise fine

review: Approve (code)
Revision history for this message
Robert Collins (lifeless) wrote :

So yeah, I can see that - however, we'll drill in and do some data gathering when we deploy and disable if problematic. From there, we can land a change if needed or not.

I'll add a NEWS entry and land.

45. By Robert Collins

Merge trunk.

46. By Robert Collins

NEWS entry.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout-templates/bin/oopstools.wsgi.in'
2--- buildout-templates/bin/oopstools.wsgi.in 2011-12-12 06:11:11 +0000
3+++ buildout-templates/bin/oopstools.wsgi.in 2012-09-19 04:28:18 +0000
4@@ -14,6 +14,11 @@
5 from oops_wsgi.django import OOPSWSGIHandler
6
7 application = OOPSWSGIHandler()
8+from timeline import wsgi as timeline_wsgi
9+from timeline_django.setup import setup_for_requests as timeline_django_setup
10+
11+timeline_django_setup()
12+application = timeline_wsgi.make_app(application)
13
14 # Report OOPSes back to us.
15 from functools import partial
16@@ -28,6 +33,13 @@
17 config = Config()
18 config.template['reporter'] = '${configuration:oops-web-amqp-reporter}'
19 install_hooks(config)
20+
21+# Attach the timeline to error reports
22+import oops_timeline
23+from timeline_django.filters import install_hooks
24+oops_timeline.install_hooks(config)
25+install_hooks(config)
26+
27 # Can add custom filters / hooks if needed - see docs.
28 factory = partial(amqp.Connection, host=settings.OOPS_WEB_AMQP_HOST,
29 userid=settings.OOPS_WEB_AMQP_USER,
30@@ -38,4 +50,5 @@
31 config.publishers.append(publisher)
32
33 # finally we can wrap the app with OOPS reporting
34-application = make_app(application, config, oops_on_status=['500'])
35+application = make_app(application, config, oops_on_status=['500'],
36+ soft_start_timeout=20000)
37
38=== modified file 'buildout-templates/src/oopstools/settings.py.in'
39--- buildout-templates/src/oopstools/settings.py.in 2012-07-27 04:27:53 +0000
40+++ buildout-templates/src/oopstools/settings.py.in 2012-09-19 04:28:18 +0000
41@@ -62,6 +62,7 @@
42 )
43
44 MIDDLEWARE_CLASSES = (
45+ 'timeline_django.middleware.TimelineMiddleware',
46 'django.middleware.common.CommonMiddleware',
47 'django.contrib.sessions.middleware.SessionMiddleware',
48 'django.contrib.auth.middleware.AuthenticationMiddleware',
49
50=== modified file 'buildout.cfg'
51--- buildout.cfg 2011-12-12 06:11:11 +0000
52+++ buildout.cfg 2012-09-19 04:28:18 +0000
53@@ -60,7 +60,6 @@
54
55 [django]
56 recipe = djangorecipe
57-version = 1.3
58 project = oopstools
59 projectegg = oopstools
60 settings = settings
61
62=== modified file 'setup.py'
63--- setup.py 2011-12-12 06:11:11 +0000
64+++ setup.py 2012-09-19 04:28:18 +0000
65@@ -50,6 +50,7 @@
66 'src/oopstools/NEWS.txt'),
67 install_requires=[
68 'BeautifulSoup',
69+ 'django',
70 'fixtures',
71 'launchpadlib',
72 'lazr.config',
73@@ -57,12 +58,15 @@
74 'oops-amqp',
75 'oops-datedir-repo',
76 'oops-wsgi',
77+ 'oops-timeline',
78 'psycopg2',
79 'pytz',
80 'setuptools',
81 'South',
82 'sqlparse',
83 'testtools',
84+ 'timeline',
85+ 'timeline_django',
86 'zope.cachedescriptors',
87 'zope.testbrowser',
88 #'Django', - installed through djangorecipe.
89
90=== modified file 'src/oopstools/NEWS.txt'
91--- src/oopstools/NEWS.txt 2012-09-18 07:46:18 +0000
92+++ src/oopstools/NEWS.txt 2012-09-19 04:28:18 +0000
93@@ -5,6 +5,12 @@
94 NEXT
95 ====
96
97+* Oops-tools now depends on newer djangorecipe, django 1.3.3. (Robert Collins)
98+
99+* Oops reports generated by oops-tools itself will now include django event
100+ data from timeline_django. This can be disabled if needed by disabling the
101+ oops_timeline hook in oopstools.wsgi. (Robert Collins)
102+
103 * When pruning, look for OOPS references up to now rather than up to
104 prune_until. Otherwise we miss any references created in the last
105 week, probably only finding references within 24 hours of the OOPS
106
107=== modified file 'versions.cfg'
108--- versions.cfg 2012-03-23 00:49:01 +0000
109+++ versions.cfg 2012-09-19 04:28:18 +0000
110@@ -13,7 +13,8 @@
111 South = 0.7.3-r929
112 Sphinx = 1.0.7
113 sqlparse = 0.1.3
114-djangorecipe = 0.19.2
115+django = 1.3.3
116+djangorecipe = 1.3
117 distribute = 0.6.12
118 docutils = 0.6
119 launchpadlib = 1.9.11
120@@ -22,12 +23,15 @@
121 oops = 0.0.10
122 oops-amqp = 0.0.5
123 oops-datedir-repo = 0.0.15
124+oops-timeline = 0.0.2
125 oops-wsgi = 0.0.10
126 # XXX: 2011-11-17 GavinPanella bug=891249: pyscopg2 2.4.2 is
127 # incompatible with Django 1.3, but 2.4.1 works fine.
128 psycopg2 = 2.4.1
129 setuptools = 0.6c11
130 testtools = 0.9.12
131+timeline = 0.0.3
132+timeline_django = 0.0.1
133 z3c.recipe.filetemplate = 2.1.0
134 z3c.recipe.sphinxdoc = 0.0.8
135 z3c.recipe.tag = 0.4.0

Subscribers

People subscribed via source and target branches

to all changes: