-
Scout Monitoring
Free Django app performance insights with Scout Monitoring. Get Scout setup in minutes, and let us sweat the small stuff. A couple lines in settings.py is all you need to start monitoring your apps. Sign up for our free tier today.
The required files to follow along in this example are available on GitHub, or here on my blog.
Further information on FastAPI GitHub Issue and Starlette GitHub Issue:
But we do not have a handler function, do we? We have a Mangum object wrapping the FastAPI application. Luckily, the Mangum object acts as a handler function, so we can just add the following in example/src/app/__init__.py:
Let's explore the next core utility in Lambda Powertools, the Metrics utility. This utility lets you easily push metrics to CloudWatch by taking care of all the necessary boilerplate. It works asynchronously by using Amazon CloudWatch Embedded Metrics Format, by logging the metrics to stdout. It also aggregates all metrics from each invocation to save on the number of calls to CloudWatch.
Related posts
-
Why the Serverless Revolution Has Stalled
-
Building Fast APIs with FastAPI: A Comprehensive Guide
-
Writing a chat application in Django 4.2 using async StreamingHttpResponse
-
Deploying an ML model to Paperspace and creating an API
-
FastAPI middleware doesn't run while making request to websocket endpoint