You Have Written A Web Application, Now What?
summary
Shows a concrete Flask+MySQL demo in Docker (Gunicorn/uWSGI processes, requests and mysql-connector libraries) that emits JSON structured logs with a propagated x-request-id header, uses python-json-logger for correlated logging, pushes metrics via statsd/statsd-exporter into Prometheus and demonstrates traces through OpenTelemetry collector into Jaeger. Code examples show middleware that starts/stops timers, increments counters, creates spans for service-to and DB calls, an ApacheBench load run, and working visualizations of request traces and latencies.
AI-written summary · about
chapters (22)
- 0:00Start
- 15:28Key things to log
- 17:36Generic strategies
- 21:02Monitoring HTTP/RPC Server applications
- 21:25Monitoring Worker applications
- 23:03Things to keep in mind
- 24:33Basic idea
- 25:08Tracking latency across services
- 26:26Instrumenting your code
- 27:45Storage/Querying
- 29:10Before Open Telemetry
- 29:56After Open Telemetry
- 31:35Flask app instrumentation for metrics
- 33:16Exporting WSGI runtime metrics
- 33:44Metrics Demo
- 40:19Distributed tracing demo
- 41:09Takeaways
- 42:17Setting up automatic horizontal scaling
- 43:10Simulate failure scenarios (Chaos Engineering)
- 44:09Other important things
- 44:31Summary
- 45:34Questions/Comments
