Open 0xjjoyy opened 4 years ago
Hi, there isn't anything specific you'd need to do in terms of Chalice configuration, you'd just need to add the library and decorate your lambda functions as described here (https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda-command-line.html). We should update our documentation though with a concrete example of how to do this with Chalice apps.
Thanks, I guess I was hoping there would be a way to apply the decorator to all the api methods, rather than manually adding to all my api methods.
Or are you saying to somehow decorate the app itself? So I can somehow decorate
app = Chalice(app_name='helloworld')
This worked for me:
app = app_main.get_app() # this includes a line chalice_app = Chalice(app_name=xxx)
Profiler(os.getenv("AWS_CODEGURU_PROFILER_GROUP_NAME")).start()
And I had to set up the codeguru group name as a non-lambda compute platform. I would appreciate official clarification if this is the right way forward.
Is there a single point of configuration that we can easily enable the CodeGuru hooks and annotations for our apis?
Python CodeGuru now available. https://aws.amazon.com/about-aws/whats-new/2020/12/python-support-for-amazon-codeguru-is-available-in-preview/