Skip to content

Commit

Permalink
bug 1163235: remove sentry from Balrog because we're using Newrelic i…
Browse files Browse the repository at this point in the history
…nstead. r=nthomas
  • Loading branch information
bhearsum committed May 27, 2015
1 parent 11480b7 commit e84b63c
Show file tree
Hide file tree
Showing 84 changed files with 1 addition and 4,963 deletions.
1 change: 0 additions & 1 deletion admin.ini-dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ logfile=/var/log/aus.log
;Where to log CEF messages. Normally set to syslog.
cef_logfile=syslog
;level=ERROR
;sentry_dsn='threaded+https://abc:def@errormill.mozilla.org/12'

[app]
; encryption key for session cookies. should be a few hundred bits
Expand Down
6 changes: 0 additions & 6 deletions admin.wsgi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ site.addsitedir(mydir)
from auslib.util import thirdparty
thirdparty.extendsyspath()

from auslib.admin.base import sentry
from auslib.config import AdminConfig
import auslib.log

Expand All @@ -36,8 +35,3 @@ dbo.setDomainWhitelist(cfg.getDomainWhitelist())
application.config['WHITELISTED_DOMAINS'] = cfg.getDomainWhitelist()
application.config['PAGE_TITLE'] = cfg.getPageTitle()
application.config['SECRET_KEY'] = cfg.getSecretKey()
application.config['SENTRY_DSN'] = cfg.getSentryDsn()
application.config['SENTRY_PROCESSORS'] = ['auslib.util.sentry.SanitizeHeadersProcessor']

if application.config['SENTRY_DSN']:
sentry.init_app(application)
3 changes: 0 additions & 3 deletions auslib/admin/base.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from flask import Flask, request
from flask_compress import Compress

from raven.contrib.flask import Sentry

import auslib

import logging
log = logging.getLogger(__name__)

app = Flask(__name__)
sentry = Sentry()

from auslib.admin.views.csrf import CSRFView
from auslib.admin.views.permissions import UsersView, PermissionsView, \
Expand Down
6 changes: 0 additions & 6 deletions auslib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ def getCefLogfile(self):
else:
return "cef.log"

def getSentryDsn(self):
if self.cfg.has_option('logging', 'sentry_dsn'):
return self.cfg.get('logging', 'sentry_dsn')
else:
return None

def getDomainWhitelist(self):
try:
return tuple(a.strip() for a in self.cfg.get('site-specific','domain_whitelist').split(','))
Expand Down
14 changes: 0 additions & 14 deletions auslib/test/web/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,17 +368,3 @@ def testEmptySnippetOn500(self):
self.assertEqual(ret.status_code, 200)
self.assertEqual(ret.mimetype, 'text/xml')
self.assertEqual(minidom.parseString(ret.data).getElementsByTagName('updates')[0].firstChild.nodeValue, '\n')

def testSentryBadDataError(self):
with mock.patch("auslib.web.views.client.ClientRequestView.get") as m:
m.side_effect = BadDataError("exterminate!")
with mock.patch("auslib.web.base.sentry") as sentry:
self.client.get("/update/4/b/1.0/1/p/l/a/a/a/a/1/update.xml")
self.assertFalse(sentry.captureException.called)

def testSentryRealError(self):
with mock.patch("auslib.web.views.client.ClientRequestView.get") as m:
m.side_effect = Exception("exterminate!")
with mock.patch("auslib.web.base.sentry") as sentry:
self.client.get("/update/4/b/1.0/1/p/l/a/a/a/a/1/update.xml")
self.assertTrue(sentry.captureException.called)
12 changes: 0 additions & 12 deletions auslib/util/sentry.py

This file was deleted.

9 changes: 1 addition & 8 deletions auslib/web/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@

from flask import Flask, make_response, send_from_directory

from raven.contrib.flask import Sentry

from auslib.AUS import AUS

app = Flask(__name__)
AUS = AUS()
sentry = Sentry()

from auslib.errors import BadDataError
from auslib.web.views.client import ClientRequestView
Expand All @@ -24,14 +21,10 @@ def fourohfour(error):

@app.errorhandler(Exception)
def generic(error):
"""Deals with any unhandled exceptions. If the exception is not a
BadDataError, it will be sent to Sentry. Regardless of the exception,
"""Deals with any unhandled exceptions. Regardless of the exception,
a 200 response with no updates is returned, because that's what the client
expects. See bugs 885173 and 1069454 for additional background."""

if not isinstance(error, BadDataError):
if sentry.client:
sentry.captureException()
log.debug('Hit exception, sending an empty response', exc_info=True)
response = make_response('<?xml version="1.0"?>\n<updates>\n</updates>')
response.mimetype = 'text/xml'
Expand Down
1 change: 0 additions & 1 deletion balrog.ini-dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ logfile=/var/log/aus.log
;Where to log CEF messages. Normally set to syslog.
cef_logfile=syslog
;level=ERROR
;sentry_dsn='threaded+https://abc:def@errormill.mozilla.org/12'

[site-specific]
;Sites that get the force=1 appended to download urls, comma separated supported
Expand Down
6 changes: 0 additions & 6 deletions balrog.wsgi
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ thirdparty.extendsyspath()

from auslib.config import ClientConfig
import auslib.log
from auslib.web.base import sentry

cfg = ClientConfig(path.join(mydir, 'balrog.ini'))
errors = cfg.validate()
Expand All @@ -49,11 +48,6 @@ dbo.setDb(cfg.getDburi())
dbo.setDomainWhitelist(cfg.getDomainWhitelist())
application.config['WHITELISTED_DOMAINS'] = cfg.getDomainWhitelist()
application.config['SPECIAL_FORCE_HOSTS'] = cfg.getSpecialForceHosts()
application.config['SENTRY_DSN'] = cfg.getSentryDsn()
application.config['SENTRY_PROCESSORS'] = ['auslib.util.sentry.SanitizeHeadersProcessor']

if application.config['SENTRY_DSN']:
sentry.init_app(application)

if newrelic:
application = newrelic.agent.wsgi_application()(application)
1 change: 0 additions & 1 deletion requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ flask-wtf==0.10.2
sqlalchemy-migrate==0.7.2
tempita==0.5.1
decorator==3.3.3
raven==3.1.13
blinker==1.2
cef==0.5
flask-compress==1.0.2
Expand Down
23 changes: 0 additions & 23 deletions vendor/lib/python/raven-3.1.13.egg-info/PKG-INFO

This file was deleted.

130 changes: 0 additions & 130 deletions vendor/lib/python/raven-3.1.13.egg-info/SOURCES.txt

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions vendor/lib/python/raven-3.1.13.egg-info/entry_points.txt

This file was deleted.

Loading

0 comments on commit e84b63c

Please sign in to comment.