Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Appstats data for a Cloud Endpoint method? [duplicate]

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.

like image 891
Kunal Grover Avatar asked Nov 23 '22 20:11

Kunal Grover


1 Answers

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.

like image 150
Kunal Grover Avatar answered May 13 '23 19:05

Kunal Grover