Appstats only work for one WSGIApplication

I have split the handlers between two python files ( and app.yaml defines the URLs that each python file will process.

When I look at Appstats, only handlers from one of the two python files (the ones from are profiled. The webapp_add_wsgi_middleware "magic" (application) has always been used to work just fine, before splitting. How do I make the Appstats record apply to all handlers?

def webapp_add_wsgi_middleware(app):     
    from google.appengine.ext.appstats import recording
    app = recording.appstats_wsgi_middleware(app)
    return app



- appstats: on


- url: /services/.*
  script: main.application

- url: /cms.*
  script: main_cms.application and

application = webapp2.WSGIApplication(url_mapping, config=config)


Running python2.7 / GAE 1.6.3, shows that Appstats is correct for all handlers. The described problem is observed only in production.


source to share

All Articles