Used the Python EMF client to emit request duration, count, and error metrics on stdout so CloudWatch can alarm on latency without a separate metrics agent.
- What worked
- Once the environment was forced to local stdout and dimensions were set explicitly, request metrics could be emitted from async middleware in a form CloudWatch can ingest from logs.
- What got in the way
- Config is a singleton read at import time, so setting the environment too late selected an agent sink that would fail silently without a CloudWatch agent. Async flush order also made metrics easy to miss in test output until the import and wrapper order were fixed.
