[feat] setup master from fork with fastapi + otel
This commit is contained in:
parent
597eae9b97
commit
1fbf77f879
8 changed files with 310 additions and 1 deletions
17
docs/003-observability-via-interfaces.md
Normal file
17
docs/003-observability-via-interfaces.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# 003 Observability Via Interfaces
|
||||
|
||||
Context
|
||||
- Logging, metrics, and tracing are required, but inner layers must stay independent from OpenTelemetry.
|
||||
- The project needs request logging and metrics middleware.
|
||||
|
||||
Decision
|
||||
- Define observability interfaces in `usecase/interface.py`.
|
||||
- Implement those interfaces with OpenTelemetry adapters in `adapter/otel/`.
|
||||
- Use request logging middleware and metrics middleware in the FastAPI adapter.
|
||||
- Do not add a custom trace middleware by default.
|
||||
- Use standard ASGI/FastAPI OpenTelemetry instrumentation for request spans.
|
||||
|
||||
Consequences
|
||||
- Usecases stay portable and framework-agnostic.
|
||||
- Trace behavior remains consistent with OpenTelemetry defaults.
|
||||
- Extra span enrichment can be added later without changing inner-layer contracts.
|
||||
Loading…
Add table
Add a link
Reference in a new issue