def enable_apptrace(app):
  try:
    from libs.apptrace import middleware
    middleware.Config.URL_PATTERNS = ['^/$']
    app.app = middleware.apptrace_middleware(app.app)
  except Exception, e:
    logging.error(
      'Failed to initialize AppTrace. Exception encountered: "' + str(e) + '".')
  return app
Utility function that enables apptrace middleware.
dataset/ETHPy150Open gregorynicholas/flask-gae_runtools/gae_runtools.py/enable_apptrace