local machine... then you deploy to production" Traffic spikes you didn't anticipate Endpoints that were fast are now slow Random errors at 3 AM (We all have been there) No visibility into what's happening You need insight into your application's performance and behavior
flask_http_request_total - Request counter by endpoint/status 2. Business Metrics orders_total{'{'}status="success|failed"{'}'} - Order tracking order_value_dollars - Transaction value distribution active_users - Current active users 3. Database Performance database_query_duration_seconds{'{'}query_type{'}'} - Query latency
<80% success for 5m DatabaseDown Connection pool exhausted Warning HighErrorRate >5% errors for 2m HighLatency p95 > 1s for 3m HighRequestRate >100 req/s for 2m
Generate normal traffic # Test business logic make test-orders # Create sample orders with metrics # Trigger error alerts make test-errors # Trigger high error rates (fires alerts) # Test performance degradation make test-slow # Hit slow endpoints # Heavy load test make test-load # Heavy load testing
over time Response Time - p50, p95, p99 percentiles Error Rate % - 4xx and 5xx trends Active Users - Real-time gauge Order Success Rate - Business KPI Database Performance - Query duration by type Endpoint Breakdown - Table of all endpoints
like latency, percentiles provide a more accurate view than averages. Example: 100 requests with 99 at 10ms and 1 at 10,000ms: Average: 109ms (looks good!) p99: 10,000ms (1% of users wait 10 seconds) The average hides a critical issue affecting user experience.
active time series 15-30 days retention For larger scale, add: Prometheus Federation - Multiple Prometheus per region Thanos/Mimir - Long-term storage (S3/GCS) Prometheus HA - 2+ replicas for reliability AlertManager Clustering - Redundant alert routing Loki Distributor - Horizontal log scaling
with one line 2. Use Alloy for unified observability - Single pipeline for metrics and logs 3. Alert intentionally - Every alert must be actionable 4. Track business metrics - Not just infrastructure 5. Structure your logs - JSON makes logs queryable