feat(observability): add observability labels and logging configuration for backend, migrate, and web services
Deploy production / deploy (push) Successful in 22s

This commit is contained in:
yuxuanhui
2026-09-16 16:44:29 +08:00
parent 20f6d0fc51
commit ba60d8e5c4
+23
View File
@@ -1,6 +1,17 @@
# Independent production configuration; do not merge with compose.yaml. # Independent production configuration; do not merge with compose.yaml.
name: wq-alpha-production name: wq-alpha-production
x-observability-labels: &observability-labels
observability.logs: "true"
observability.project: "wq-alpha"
observability.env: "production"
x-container-logging: &container-logging
driver: json-file
options:
max-size: "20m"
max-file: "5"
x-backend: &backend x-backend: &backend
image: wq-alpha-production-backend:${DEPLOY_TAG:-local} image: wq-alpha-production-backend:${DEPLOY_TAG:-local}
build: build:
@@ -28,6 +39,10 @@ x-backend: &backend
services: services:
backend: backend:
<<: *backend <<: *backend
labels:
<<: *observability-labels
observability.service: "backend"
logging: *container-logging
# Migration is run separately with all application writers stopped. # Migration is run separately with all application writers stopped.
command: [uvicorn, 'app.main:create_app', --factory, --host, 0.0.0.0, --port, '8000', --workers, '1', --proxy-headers] command: [uvicorn, 'app.main:create_app', --factory, --host, 0.0.0.0, --port, '8000', --workers, '1', --proxy-headers]
healthcheck: healthcheck:
@@ -40,10 +55,18 @@ services:
restart: unless-stopped restart: unless-stopped
migrate: migrate:
<<: *backend <<: *backend
labels:
<<: *observability-labels
observability.service: "migrate"
logging: *container-logging
profiles: [jobs] profiles: [jobs]
command: [alembic, upgrade, head] command: [alembic, upgrade, head]
restart: 'no' restart: 'no'
web: web:
labels:
<<: *observability-labels
observability.service: "web"
logging: *container-logging
image: wq-alpha-production-web:${DEPLOY_TAG:-local} image: wq-alpha-production-web:${DEPLOY_TAG:-local}
build: build:
context: . context: .