From c180921bea1422b26816009e25c8643f6ec6cf20 Mon Sep 17 00:00:00 2001 From: "ivan.stasevich" Date: Wed, 23 Sep 2026 08:52:23 +0300 Subject: [PATCH 1/6] feat: enhance observability with health and debug routes, update tracing configuration --- docker-compose.dev.yml | 2 +- docker-compose.observability.yml | 36 ++++++++++++++-------- fastid/api/app.py | 3 +- fastid/api/routing.py | 29 ----------------- fastid/core/app.py | 12 ++++++++ fastid/core/debug.py | 13 ++++++++ fastid/core/health.py | 27 ++++++++++++++++ fastid/plugins/observability/config.py | 4 ++- fastid/plugins/observability/metrics.py | 3 +- fastid/plugins/observability/prometheus.py | 2 +- fastid/plugins/observability/tracing.py | 17 +++++++--- 11 files changed, 96 insertions(+), 52 deletions(-) create mode 100644 fastid/core/debug.py create mode 100644 fastid/core/health.py diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 8cc7dd1..d05b9ac 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -74,7 +74,7 @@ services: - "./certs:/opt/fastid/certs" healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost:8000/api/v1/readiness" ] + test: [ "CMD", "curl", "-f", "http://localhost:8000/readiness" ] interval: 30s timeout: 10s retries: 3 diff --git a/docker-compose.observability.yml b/docker-compose.observability.yml index aa1f573..d9fffcc 100644 --- a/docker-compose.observability.yml +++ b/docker-compose.observability.yml @@ -1,25 +1,35 @@ x-logging: &default-logging - driver: loki + driver: json-file options: - loki-url: '${LOKI_URL:-http://localhost:3100/api/prom/push}' - loki-pipeline-stages: | - - multiline: - firstline: '^\d{4}-\d{2}-\d{2} \d{1,2}:\d{2}:\d{2}' - max_wait_time: 3s - - regex: - expression: '^(?P