feat(observability): add structured application logging

Emit correlated JSON logs from the API and FunASR services, propagate request IDs to the client, and configure bounded opt-in Docker logging.

Document the host-wide Grafana/Loki query workflow and keep observability deployment ownership outside the application repository.
This commit is contained in:
2026-07-22 13:52:40 +08:00
parent a63e9a1705
commit a875fe9f63
30 changed files with 1261 additions and 817 deletions

View File

@@ -28,6 +28,8 @@ RUN --mount=type=cache,id=teaching-feedback-cargo-registry,target=/usr/local/car
FROM debian:bookworm-slim AS runtime
ARG DEBIAN_MIRROR=http://deb.debian.org
ARG APP_VERSION=0.2.0
ARG GIT_SHA=unknown
RUN sed -i "s|http://deb.debian.org|${DEBIAN_MIRROR}|g" /etc/apt/sources.list.d/debian.sources \
&& apt-get update \
@@ -44,7 +46,11 @@ COPY --from=builder /build/output/migrate-user-owner /usr/local/bin/migrate-user
ENV HOST=0.0.0.0 \
PORT=8080 \
AUDIO_STORAGE_DIR=/data/audio \
RUST_LOG=info
RUST_LOG=info \
APP_ENV=lan \
APP_VERSION=${APP_VERSION} \
GIT_SHA=${GIT_SHA} \
LOG_FORMAT=json
USER app