summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorSandyWalsh <sandy.walsh@rackspace.com>2012-09-19 11:19:37 -0300
committerSandyWalsh <sandy.walsh@rackspace.com>2012-09-19 16:10:04 -0300
commit4de976ccf8f27c152f89aecc7ded2c2cd9d0a710 (patch)
treead36bcfc1df9204bd73b600d17941f1bc2a20a29 /nova/api
parenta484bfea8ff3f274bb71be11ff387aa671c1e798 (diff)
downloadnova-4de976ccf8f27c152f89aecc7ded2c2cd9d0a710.tar.gz
nova-4de976ccf8f27c152f89aecc7ded2c2cd9d0a710.tar.xz
nova-4de976ccf8f27c152f89aecc7ded2c2cd9d0a710.zip
Send api.fault notification on API service faults.
Exceptions caught by the API middleware will now send "api.fault" notifications indicating the offending URL and the underlying exception. The allows the billing/usage systems to track requests end-to-end without having to monitor log files. Disabled by default. Enable with --notify_api_faults Change-Id: Ied2783259413ba12d686b44b33e0707645e51afb
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/api/openstack/__init__.py b/nova/api/openstack/__init__.py
index 12dd8ae83..ada6024cf 100644
--- a/nova/api/openstack/__init__.py
+++ b/nova/api/openstack/__init__.py
@@ -25,6 +25,7 @@ import webob.dec
import webob.exc
from nova.api.openstack import wsgi
+from nova import notifications
from nova.openstack.common import log as logging
from nova import utils
from nova import wsgi as base_wsgi
@@ -70,6 +71,8 @@ class FaultWrapper(base_wsgi.Middleware):
if safe:
outer.explanation = '%s: %s' % (inner.__class__.__name__,
unicode(inner))
+
+ notifications.send_api_fault(req.url, status, inner)
return wsgi.Fault(outer)
@webob.dec.wsgify(RequestClass=wsgi.Request)