semantics

This commit is contained in:
2026-05-26 09:30:41 +03:00
parent 1e7bcecaea
commit 9ffa8af1dc
623 changed files with 28045 additions and 26557 deletions

View File

@@ -1,13 +1,13 @@
# #region TraceContextMiddlewareModule [C:3] [TYPE Module] [SEMANTICS fastapi, middleware, trace, context, request]
# @BRIEF FastAPI/Starlette middleware that seeds a trace_id for every incoming HTTP request.
# Optionally extracts X-Trace-ID header for cross-service trace propagation.
# @LAYER: Core
# @LAYER Core
# @RELATION DEPENDS_ON -> [CotLoggerModule]
# @RELATION CALLED_BY -> [AppModule]
# @PRE: FastAPI app instance with Starlette middleware support.
# @POST: Every request gets a trace_id via seed_trace_id(). Existing X-Trace-ID header is
# @PRE FastAPI app instance with Starlette middleware support.
# @POST Every request gets a trace_id via seed_trace_id(). Existing X-Trace-ID header is
# preserved and used as the trace_id when present.
# @SIDE_EFFECT: Sets ContextVar _trace_id for the duration of the request.
# @SIDE_EFFECT Sets ContextVar _trace_id for the duration of the request.
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.requests import Request