AWS introduced Amazon CloudWatch Application Signals, a feature designed to monitor Java applications' health. Now, this feature extends its support to Python applications. With Application Signals, users can leverage AWS Distro for OpenTelemetry (ADOT) to instrument Python applications seamlessly, eliminating the need for code modifications. This enables the collection of essential metrics and traces from Python libraries and frameworks, facilitating rapid operational health triage and performance monitoring without the hassle of custom code or dashboard creation.
The blog post provides a comprehensive guide on integrating Application Signals with Python applications deployed on an Amazon EKS cluster, specifically focusing on Django-based applications and popular libraries like psycopg2, boto3, and requests. Here's an overview of the solution:
Solution Overview:
The demo application combines Spring Cloud and Django frameworks, with services registering themselves with the Eureka discovery service. Key components include services for insurances and billing, which utilize Django REST frameworks for API exposure and interact with external services using the requests library. These services also access Amazon RDS for PostgreSQL using psycopg2 and store billing information in AWS DynamoDB using the boto3 library.
Solution Architecture:
The architecture involves deploying resources using Terraform, with the Amazon CloudWatch Observability EKS add-on orchestrating metrics, logs, and traces via the CloudWatch agent and Fluent Bit as DaemonSet.
Prerequisites:
To proceed, ensure you have a valid AWS Account, AWS CLI v2 installed and configured, Terraform, kubectl, and Docker installed.
Solution Walkthrough:
Enabling Application Signals: Follow the provided instructions to enable Application Signals in your AWS account.
Deploying Application using Terraform: Set up environment variables and deploy the application using Terraform scripts.
Configure kubectl: Update the kubeconfig file to add the Amazon EKS Cluster endpoint locally.
Deploy Kubernetes Resources with Annotations: Add the necessary annotations to Kubernetes manifests to enable Application Signals for Python applications.
Verify Deployment Results: Confirm successful deployment by checking the status of pods.
Create CloudWatch Synthetics canaries to generate traffic: Generate traffic for the application using CloudWatch Synthetics canaries.
Visualizing application using CloudWatch Application Signals: Utilize the CloudWatch console to monitor services, view service operations, traces, and logs, and create service level objectives (SLOs).
Clean Up: To stop incurring charges, clean up the application resources using provided commands.
Following these steps will enable you to seamlessly integrate Application Signals with Python applications deployed on an Amazon EKS cluster and effectively monitor their operational health and performance.
Source :- https://aws.amazon.com/blogs/mt/monitoring-python-apps-using-amazon-cloudwatch-application-signals/