raven: Specify all application code path prefixes

The raven client inspects the traceback and attempts to figure out which
parts belong to the app and which belong to external libraries. It uses
a whitelist of paths to identify application code. Previously we had been
using the list of repository names, but that was incorrect because the
plugin "liveupdate" is actually called "reddit_liveupdate" in the traceback.
The whitelist was also incomplete because it didn't account for scripts run with
paster run which can have a path like /opt/something/script.py.
This commit is contained in:
Brian Simpson
2016-10-19 14:22:37 -07:00
parent 1d0dda280a
commit 2fdddb69e4

View File

@@ -164,7 +164,11 @@ class RavenErrorReporter(Reporter):
@classmethod
def get_raven_client(cls):
repositories = g.versions.keys()
app_path_prefixes = [
"r2",
"reddit_", # plugins such as 'reddit_liveupdate'
"/opt/", # scripts may be run from /opt/REPO/scripts
]
release_str = '|'.join(
"%s:%s" % (repo, commit_hash)
for repo, commit_hash in sorted(g.versions.items())
@@ -175,7 +179,7 @@ class RavenErrorReporter(Reporter):
dsn=g.sentry_dsn,
# use the default transport to send errors from another thread:
transport=raven.transport.threaded.ThreadedHTTPTransport,
include_paths=repositories,
include_paths=app_path_prefixes,
processors=[
'raven.processors.SanitizePasswordsProcessor',
'r2.lib.log.SanitizeStackLocalsProcessor',