Merge pull request #545 from crankycoder/vng/extended_metlog_debugging
bug 822759 - more debugging patches to diagnose problem in -dev
This commit is contained in:
Коммит
b7009da44d
|
@ -294,14 +294,6 @@ class GenerateErrorForm(happyforms.Form):
|
|||
from metlog.config import client_from_dict_config
|
||||
new_metlog = client_from_dict_config(settings.METLOG_CONF)
|
||||
|
||||
# The next two variables are captured by the raven client as local variables
|
||||
# which are passed into the sentry server.
|
||||
# They are needed to verify that the active metlog
|
||||
# configuration is not the actual expected metlog
|
||||
# configuration.
|
||||
metlog_conf = settings.METLOG_CONF
|
||||
active_metlog_conf = settings.METLOG._config
|
||||
|
||||
if error == 'zerodivisionerror':
|
||||
1 / 0
|
||||
elif error == 'iorequesterror':
|
||||
|
@ -319,17 +311,37 @@ class GenerateErrorForm(happyforms.Form):
|
|||
'cef.product': 'zamboni',
|
||||
'cef': True}
|
||||
|
||||
settings.METLOG.cef('xx\nx|xx\rx', 5, environ, config,
|
||||
username='me', ext1='ok=ok', ext2='ok\\ok',
|
||||
logger_info='settings.METLOG')
|
||||
new_metlog.cef('xx\nx|xx\rx', 5, environ, config,
|
||||
username='me', ext1='ok=ok', ext2='ok\\ok')
|
||||
username='me', ext1='ok=ok', ext2='ok\\ok',
|
||||
logger_info='new_metlog')
|
||||
elif error == 'metlog_statsd':
|
||||
new_metlog.incr(name=LOGGER_NAME)
|
||||
new_metlog.incr(name="new_metlog:" + LOGGER_NAME)
|
||||
settings.METLOG.incr(name=LOGGER_NAME)
|
||||
elif error == 'metlog_json':
|
||||
new_metlog.metlog(type="metlog_json",
|
||||
fields={'foo': 'bar', 'secret': 42})
|
||||
fields={'foo': 'bar', 'secret': 42,
|
||||
'logger_type': 'new_metlog'})
|
||||
settings.METLOG.metlog(type="metlog_json",
|
||||
fields={'foo': 'bar', 'secret': 42,
|
||||
'logger_type': 'settings.METLOG'})
|
||||
|
||||
elif error == 'metlog_sentry':
|
||||
# If this works, we have some kind of import ordering
|
||||
# problem
|
||||
# Try to fire off two messages to verify that we don't
|
||||
# have some kind of transient issue where settings.METLOG
|
||||
# doesn't work
|
||||
try:
|
||||
1 / 0
|
||||
2 / 0
|
||||
except:
|
||||
new_metlog.raven('metlog_sentry error triggered')
|
||||
new_metlog.raven('new_metlog: metlog_sentry error triggered',
|
||||
metlog_conf=settings.METLOG_CONF,
|
||||
active_metlog_conf=settings.METLOG._config,)
|
||||
finally:
|
||||
try:
|
||||
1 / 0
|
||||
except:
|
||||
settings.METLOG.raven('metlog_sentry error triggered',
|
||||
metlog_conf=settings.METLOG_CONF,
|
||||
active_metlog_conf=settings.METLOG._config,)
|
||||
|
|
|
@ -4,7 +4,6 @@ import json
|
|||
|
||||
from django.conf import settings
|
||||
from nose.tools import eq_
|
||||
from nose import SkipTest
|
||||
from pyquery import PyQuery as pq
|
||||
|
||||
import amo
|
||||
|
@ -51,7 +50,6 @@ class TestGenerateError(amo.tests.TestCase):
|
|||
self.metlog.sender.msgs.clear()
|
||||
|
||||
def test_metlog_statsd(self):
|
||||
raise SkipTest("this always passes in test, but not on -dev")
|
||||
self.url = reverse('zadmin.generate-error')
|
||||
self.client.post(self.url,
|
||||
{'error': 'metlog_statsd'})
|
||||
|
@ -67,7 +65,6 @@ class TestGenerateError(amo.tests.TestCase):
|
|||
eq_(msg['fields']['name'], 'z.zadmin')
|
||||
|
||||
def test_metlog_json(self):
|
||||
raise SkipTest("this always passes in test, but not on -dev")
|
||||
self.url = reverse('zadmin.generate-error')
|
||||
self.client.post(self.url,
|
||||
{'error': 'metlog_json'})
|
||||
|
@ -81,7 +78,6 @@ class TestGenerateError(amo.tests.TestCase):
|
|||
eq_(msg['fields']['secret'], 42)
|
||||
|
||||
def test_metlog_cef(self):
|
||||
raise SkipTest("this always passes in test, but not on -dev")
|
||||
self.url = reverse('zadmin.generate-error')
|
||||
self.client.post(self.url,
|
||||
{'error': 'metlog_cef'})
|
||||
|
@ -93,7 +89,6 @@ class TestGenerateError(amo.tests.TestCase):
|
|||
eq_(msg['logger'], 'zamboni')
|
||||
|
||||
def test_metlog_sentry(self):
|
||||
raise SkipTest("this always passes in test, but not on -dev")
|
||||
self.url = reverse('zadmin.generate-error')
|
||||
self.client.post(self.url,
|
||||
{'error': 'metlog_sentry'})
|
||||
|
|
|
@ -45,7 +45,7 @@ html5lib==0.90
|
|||
httplib2==0.7.6
|
||||
importlib==1.0.2
|
||||
kombu==2.1.2
|
||||
metlog-py==0.9.9
|
||||
metlog-py==0.9.10
|
||||
metlog-cef==0.2
|
||||
metlog-raven==0.3
|
||||
mimeparse==0.1.3
|
||||
|
|
|
@ -80,6 +80,20 @@ AMO_LANGUAGES = AMO_LANGUAGES + ('dbg',)
|
|||
LANGUAGES = lazy(lazy_langs, dict)(AMO_LANGUAGES)
|
||||
LANGUAGE_URL_MAP = dict([(i.lower(), i) for i in AMO_LANGUAGES])
|
||||
|
||||
METLOG_CONF['logger'] = 'addons-dev'
|
||||
METLOG_CONF['plugins']['raven'] = ('metlog_raven.raven_plugin:config_plugin', {'dsn': private_addons.SENTRY_DSN})
|
||||
METLOG_CONF = {
|
||||
'plugins': {'cef': ('metlog_cef.cef_plugin:config_plugin', {}),
|
||||
'raven': (
|
||||
'metlog_raven.raven_plugin:config_plugin', {'dsn': private_addons.SENTRY_DSN}),
|
||||
},
|
||||
'sender': {
|
||||
'class': 'metlog.senders.UdpSender',
|
||||
'host': splitstrip(private.METLOG_CONF_SENDER_HOST),
|
||||
'port': private.METLOG_CONF_SENDER_PORT,
|
||||
},
|
||||
'logger': 'addons-dev',
|
||||
}
|
||||
|
||||
METLOG = client_from_dict_config(METLOG_CONF)
|
||||
|
||||
USE_METLOG_FOR_CEF = True
|
||||
USE_METLOG_FOR_RAVEN = False
|
||||
|
|
|
@ -188,16 +188,4 @@ XSENDFILE_HEADER = 'X-Accel-Redirect'
|
|||
|
||||
GEOIP_NOOP = 0
|
||||
|
||||
METLOG_CONF = {
|
||||
'plugins': {'cef': ('metlog_cef.cef_plugin:config_plugin', {})},
|
||||
'sender': {
|
||||
'class': 'metlog.senders.UdpSender',
|
||||
'host': splitstrip(private.METLOG_CONF_SENDER_HOST),
|
||||
'port': private.METLOG_CONF_SENDER_PORT,
|
||||
},
|
||||
}
|
||||
|
||||
USE_METLOG_FOR_CEF = True
|
||||
USE_METLOG_FOR_RAVEN = False
|
||||
|
||||
ALLOW_SELF_REVIEWS = True
|
||||
|
|
|
@ -146,10 +146,21 @@ SIGNED_APPS_SERVER = private_mkt.SIGNED_APPS_SERVER
|
|||
SIGNED_APPS_REVIEWER_SERVER_ACTIVE = True
|
||||
SIGNED_APPS_REVIEWER_SERVER = private_mkt.SIGNED_APPS_REVIEWER_SERVER
|
||||
|
||||
METLOG_CONF['logger'] = 'addons-marketplace-dev'
|
||||
METLOG_CONF['plugins']['raven'] = (
|
||||
'metlog_raven.raven_plugin:config_plugin', {'dsn': SENTRY_DSN})
|
||||
METLOG_CONF = {
|
||||
'plugins': {'cef': ('metlog_cef.cef_plugin:config_plugin', {}),
|
||||
'raven': (
|
||||
'metlog_raven.raven_plugin:config_plugin', {'dsn': SENTRY_DSN}),
|
||||
},
|
||||
'sender': {
|
||||
'class': 'metlog.senders.UdpSender',
|
||||
'host': splitstrip(private.METLOG_CONF_SENDER_HOST),
|
||||
'port': private.METLOG_CONF_SENDER_PORT,
|
||||
},
|
||||
'logger': 'addons-marketplace-dev',
|
||||
}
|
||||
METLOG = client_from_dict_config(METLOG_CONF)
|
||||
USE_METLOG_FOR_CEF = True
|
||||
USE_METLOG_FOR_RAVEN = False
|
||||
|
||||
WEBTRENDS_USERNAME = private_mkt.WEBTRENDS_USERNAME
|
||||
WEBTRENDS_PASSWORD = private_mkt.WEBTRENDS_PASSWORD
|
||||
|
|
Загрузка…
Ссылка в новой задаче