CPT is a distributed application running on Google Cloud Run. Current observability is limited to default Cloud Logging. For a "world-class" application, we need deep visibility into request traces, proactive alerting for external API failures (Tesla/Stripe), and centralized log management.
CloudJsonFormatter in app/core/logging_config.py. Outputs to stdout with Cloud Logging severity mapping. Context fields (session_id, payment_id, vin_suffix, request_id) propagated via ContextVar.app/core/tracing.py. Auto-instruments FastAPI, httpx (Tesla/Stripe/PayPal), and Redis. Exports to Google Cloud Trace via OTLP in deployed envs, console in local dev.140-gcp-cloud-monitor provisions log-based metrics and alert policies for Tesla API errors, payment failures, PDF generation errors, and 5xx server errors. Email notifications via Cloud Monitoring.tesla-api-errors tracks all Tesla API failures. Alert policy fires on >10 errors in 5 minutes. Health dashboard visualizes error rate.CloudJsonFormatter, request context middleware, session context in TeslaFleetService).app/core/tracing.py. Auto-instruments FastAPI, httpx, and Redis. Exports to Cloud Trace.140-gcp-cloud-monitor with Tesla API error rate, payment error rate, API latency p95/p99, and resource utilization panels.app/core/logging_config.py, request context middleware, session context propagation)app/core/tracing.py with OpenTelemetry SDK, Cloud Trace exporter, auto-instrumentation for FastAPI/httpx/Redis140-gcp-cloud-monitor with log-based metrics + alert policies (Tesla, payment, PDF, 5xx)140-gcp-cloud-monitor with 10-panel mosaic dashboard (throughput, latency, errors, resources)