Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
raven: Specify all application code path prefixes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bsimpson63 committed Oct 19, 2016
1 parent 1d0dda2 commit 2fdddb6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions r2/r2/lib/log.py
Expand Up @@ -164,7 +164,11 @@ def add_user_context(cls, client):

@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())
Expand All @@ -175,7 +179,7 @@ def get_raven_client(cls):
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',
Expand Down

0 comments on commit 2fdddb6

Please sign in to comment.