mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
48cb4be4cd
The lifespan-based instrumentation only runs when FastAPI app starts. In MCP context, the app never starts but the httpx client is still used. Solution: Instrument the client immediately after creation at module level. This works in both contexts: - MCP: client is instrumented when module is imported - API: client is instrumented before lifespan runs (lifespan still safe) This enables distributed tracing from MCP -> Cloud -> API. Signed-off-by: phernandez <paul@basicmachines.co>