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:
@@ -1,7 +1,19 @@
|
||||
name: teaching-feedback
|
||||
|
||||
x-api-base: &api-base
|
||||
image: teaching-feedback-api:0.1.0
|
||||
image: teaching-feedback-api:${APP_VERSION:-0.2.0}
|
||||
|
||||
x-default-logging: &default-logging
|
||||
driver: local
|
||||
options:
|
||||
max-size: "20m"
|
||||
max-file: "5"
|
||||
|
||||
x-observability-labels: &observability-labels
|
||||
observability.logs: "true"
|
||||
observability.application: "teaching-feedback"
|
||||
observability.environment: "lan"
|
||||
observability.app_version: "${APP_VERSION:-0.2.0}"
|
||||
|
||||
services:
|
||||
funasr:
|
||||
@@ -12,7 +24,13 @@ services:
|
||||
args:
|
||||
DEBIAN_MIRROR: http://mirrors.ustc.edu.cn
|
||||
PYPI_INDEX_URL: https://mirrors.ustc.edu.cn/pypi/simple
|
||||
APP_VERSION: ${APP_VERSION:-0.2.0}
|
||||
GIT_SHA: ${GIT_SHA:-unknown}
|
||||
environment:
|
||||
APP_ENV: lan
|
||||
APP_VERSION: ${APP_VERSION:-0.2.0}
|
||||
GIT_SHA: ${GIT_SHA:-unknown}
|
||||
LOG_FORMAT: json
|
||||
ASR_MODEL: paraformer-zh
|
||||
ASR_VAD_MODEL: fsmn-vad
|
||||
ASR_PUNC_MODEL: ct-punc
|
||||
@@ -20,6 +38,8 @@ services:
|
||||
ASR_MAX_CONCURRENCY: "1"
|
||||
ASR_BATCH_SIZE_SECONDS: "300"
|
||||
MODELSCOPE_CACHE: /models
|
||||
labels: *observability-labels
|
||||
logging: *default-logging
|
||||
volumes:
|
||||
- funasr-model-cache:/models
|
||||
restart: unless-stopped
|
||||
@@ -40,6 +60,13 @@ services:
|
||||
<<: *api-base
|
||||
env_file:
|
||||
- ./server/.env
|
||||
environment:
|
||||
APP_ENV: lan
|
||||
APP_VERSION: ${APP_VERSION:-0.2.0}
|
||||
GIT_SHA: ${GIT_SHA:-unknown}
|
||||
LOG_FORMAT: json
|
||||
labels: *observability-labels
|
||||
logging: *default-logging
|
||||
command:
|
||||
- migrate
|
||||
restart: "no"
|
||||
@@ -53,9 +80,15 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
DEBIAN_MIRROR: http://mirrors.ustc.edu.cn
|
||||
APP_VERSION: ${APP_VERSION:-0.2.0}
|
||||
GIT_SHA: ${GIT_SHA:-unknown}
|
||||
env_file:
|
||||
- ./server/.env
|
||||
environment:
|
||||
APP_ENV: lan
|
||||
APP_VERSION: ${APP_VERSION:-0.2.0}
|
||||
GIT_SHA: ${GIT_SHA:-unknown}
|
||||
LOG_FORMAT: json
|
||||
HOST: 0.0.0.0
|
||||
PORT: "8080"
|
||||
AUDIO_STORAGE_DIR: /data/audio
|
||||
@@ -66,6 +99,8 @@ services:
|
||||
ASR_JOB_LEASE_SECONDS: "3600"
|
||||
DATABASE_MAX_CONNECTIONS: "5"
|
||||
ALLOW_DEVELOPMENT_USER_HEADER: "false"
|
||||
labels: *observability-labels
|
||||
logging: *default-logging
|
||||
ports:
|
||||
- "39180:8080"
|
||||
volumes:
|
||||
|
||||
Reference in New Issue
Block a user