Skip to content

CloudWatch Application Signals not showing Flask app requests via ALB

0

I recently integrated CloudWatch Application Signals (auto-instrumentation) into our Python Flask backend app running on a Windows EC2 instance. Everything seems correctly set up, but when I check the CloudWatch console, under Service Operations, I don't see any of the incoming requests that the app is supposed to receive.

Here's the catch: these requests are coming from Heroku, and before they hit the EC2 instance, they're routed through an Application Load Balancer (ALB).

Is auto-instrumentation still supposed to work in this kind of setup (Heroku ➝ ALB ➝ EC2)? Do I need to do anything special to ensure that CloudWatch can capture request-level metrics in this flow?

Any insights or experience with this kind of setup would be appreciated!

i follow this AWS doc: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Signals-Enable-EC2Main.html

1 Answer
0

Based on your setup with a Python Flask application running on Windows EC2 behind an Application Load Balancer (ALB), there are a few potential reasons why CloudWatch Application Signals might not be showing your requests.

If you're using a WSGI server like Gunicorn or uWSGI with your Flask application, you'll need to make additional configuration changes to make the AWS Distro for OpenTelemetry (ADOT) Python auto-instrumentation work properly. The standard auto-instrumentation might not capture the requests correctly in this case.

Another possibility is related to how the requests are being processed. Since your requests are coming from Heroku through an ALB before reaching your EC2 instance, there might be connection issues at the HTTP/SSL layer. If the ALB is accepting TCP connections but failing to complete the HTTP/HTTPS request processing, this could prevent Application Signals from capturing the requests properly.

To troubleshoot this issue:

  1. Check if you're using a WSGI server and make the necessary configuration adjustments.
  2. Verify that the ALB is properly processing the requests (check metrics like RequestCount in CloudWatch).
  3. Ensure that your security groups and network configurations allow proper traffic flow.
  4. Confirm that Application Signals is properly enabled and the required environment variables are set correctly.

CloudWatch Application Signals should work with your setup as it's designed to monitor applications across various deployment architectures, including those behind load balancers. The auto-instrumentation adds the necessary telemetry collection without requiring code changes, but the specific environment might need additional configuration.
Sources
Troubleshooting your Application Signals installation - Amazon CloudWatch
ALB Connections Accepted but No Requests Processed – HTTPS Hangs (RequestCount = 0) | AWS re:Post
Monitor application performance with Amazon CloudWatch Application Signals - AWS Lambda

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.