Files
template-fastapi/deploy
Aleksei Sokol 53f14a8624
All checks were successful
Run linters on applied template / Python 3.13 lint and build (push) Successful in 1m40s
Version 0.4.0
Changes:
- put ObservabilityMiddleware before ExceptionHandlerMiddleware to avoid repetative code
- add application startup and last metrics update metrics along with CPU usage metric and threads count
- move host and port to new uvicorn section at config along with new reload and forwarded_allow_ips
- add request_id and remove trace_id/span_id generation if tracing is disabled
- move logging logic from utils to observability
- pass trace_id/span_id in HEX form
2026-01-03 16:29:58 +03:00
..
2026-01-03 16:29:58 +03:00
2026-01-03 16:29:58 +03:00
2025-11-29 22:13:34 +03:00
2025-12-06 19:41:33 +03:00
2025-11-29 22:13:34 +03:00

deploy example

This is a complete deployment example with following services:

  • postgres database (with initialization and rootless user):
    • 5432 port exposure commented
  • api (with data migrations) with 8080 port exposure:
    • configured by configs/api.yaml
    • exposes 8080 port
    • 9090 metrics port not exposed
  • prometheus to collect metrics
  • grafana as a powerful UI for metrics visualization
    • exposes 3000 port, default user:password is admin:admin
    • prometheus metrics are available at http://prometheus:9090
  • jaeger to collect and show traces
    • exposes UI at port 16686
  • otel (OpenTELemetry) agent working as proxy for jaeger
    • configured by configs/otel.yaml
    • does not expose 4317/4318 ports as containers use it inside the internal network