Setting up metrics for Google Cloud endpoints

2019-03-02 02:16发布

I want to set up Google Cloud endpoints on a production server. What would be a good way to profile requests? Appstats support only WSGI requests.

Thanks in advance.

1条回答
看我几分像从前
2楼-- · 2019-03-02 03:08

I could actually solve this. Digging into endpoints, I could see that it is actually a WSGI server. And tested it with Appstats and works perfectly, it needs to be added to documentation.

In appengine_config.py, I did this:

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

This works well on production too.

查看更多
登录 后发表回答