feat(MCP): Set up logging and OpenTelemetry export#7706
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
Reuse flagsmith-common's structlog stack: console/JSON log rendering via setup_logging, and — when OTEL_EXPORTER_OTLP_ENDPOINT is set — OTLP export of structlog events with trace correlation, plus a global tracer provider, which also activates FastMCP's built-in per-request spans. The FastMCP banner is disabled and uvicorn logs propagate to the root logger, keeping output machine-readable under LOG_FORMAT=json. beep boop
b43159c to
7298c54
Compare
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Stacked on #7705.
Reuses flagsmith-common's structlog stack:
setup_loggingfor console/JSON rendering supportingLOG_LEVEL,LOG_FORMATenvironment variables.OTEL_EXPORTER_OTLP_ENDPOINTis set: OTLP export of structlog events with trace correlation, and a global tracer provider — which also activates FastMCP's built-in per-request server spans.OTEL_SERVICE_NAMEdefaults toflagsmith-mcp.No structured events are emitted yet — tool call events are a follow-up.
How did you test this code?
Unit and integration tests (100% coverage gate). Manually: ran the server in both log formats and verified every output line parses as JSON under
LOG_FORMAT=json.