From 182f80b8ab1d0f67fd2a37aa5b8a7e49019398ef Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sat, 9 Jun 2012 11:07:24 -0400 Subject: [PATCH] raven and newrelic --- httpbin/core.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/httpbin/core.py b/httpbin/core.py index ee0ad8d..1fad64c 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -11,7 +11,11 @@ import base64 import json import os import time + +import newrelic.agent + from flask import Flask, Response, request, render_template, redirect, jsonify +from raven.contrib.flask import Sentry from werkzeug.datastructures import WWWAuthenticate from . import filters @@ -19,13 +23,6 @@ from .helpers import get_headers, status_code, get_dict, check_basic_auth, check from .utils import weighted_choice from .structures import CaseInsensitiveDict -try: - import newrelic.agent - newrelic.agent.initialize() -except ImportError: - pass - - ENV_COOKIES = ( '_gauges_unique', '_gauges_unique_year', @@ -39,6 +36,9 @@ ENV_COOKIES = ( app = Flask(__name__) +# Setup error collection +sentry = Sentry(app) +newrelic.agent.initialize() # ------ # Routes