Repository navigation
fix(mcp): set Datadog log status from JSON levels and quiet noisy hosted loggers - #1357
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Note 📝 PR Converted to Draft More info...Thank you for creating this PR. As a policy to protect our engineers' time, Airbyte requires all PRs to be created first in draft status. Your PR has been automatically converted to draft status in respect for this policy. As soon as your PR is ready for formal review, you can proceed to convert the PR to "ready for review" status by clicking the "Ready for review" button at the bottom of the PR page. To skip draft status in future PRs, please include |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791620431-mcp-json-log-levels' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791620431-mcp-json-log-levels'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-no-credsThe overall line coverage in commit e56872d in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall line coverage in commit e56872d in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytest-unitThe overall line coverage in commit e56872d in the Show a line coverage summary of the most covered files.
Updated |
|
Codex (@codex) review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42166c13b5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
…es after tracing install
b917bdd
into
release-candidate/v1
TL;DR: In Datadog, cloud-mcp's hosted JSON logs all show as
info, and some come through twice. This PR addslevelnameto every JSON log line so Datadog reads the real level, routes ddtrace's logs through the root JSON handler so they're no longer duplicated, and quiets three noisy log sources in JSON mode only.Summary
Status: our org's Datadog
source:pythonpipeline takes the status fromlevelname, notseverity. A direct Logs API test with three otherwise identical lines gave:severity: ERROR→infolevel: ERROR→infolevelname: ERROR→error_add_severitynow writes both fields. Cloud Logging keeps readingseverity.Duplicates: ddtrace installs its own stderr
StreamHandler, so about 960 of the ~1,020errorlines a day were a second, raw copy of a ddtrace warning.ddtracejoins_SELF_HANDLED_LOGGERS, so the JSON setup clears that handler and lets ddtrace's records go through the root JSON handler.apply_json_logger_overrides().configure_logging("json")calls it, andmain()calls it again afterinstall(app), because importing ddtrace lazily (a start withoutddtrace-run) reinstalls its handler. The hosted image starts withddtrace-run, so prod already imports ddtrace first.Noise (JSON mode only; text mode is unchanged):
mcp.server.streamable_httpTerminating session: None, about 7,700 lines a dayddtrace.contrib.internal.grpc.aio_client_interceptorddtrace.llmobs._llmobsFailed to extract trace/span ID from request headers.The LLMObs logger keeps its level, so warnings that matter (e.g.
Failed to flush LLMObs spans and evaluation metrics.) still show up.Heads-up for monitors: once this ships, Datadog will show about 900 real
errorlines a day for cloud-mcp. Most are fastmcp'sError calling tool ..., which fastmcp logs at ERROR for every tool failure, caller mistakes included. Any monitor on cloud-mcp error logs will start counting them.Tests in
tests/unit_tests/test_mcp_logging.py:levelname == severityon the WARNING and ERROR JSON lines;main()removes a ddtrace handler thatinstallre-adds;The
restore_loggingfixture restores the handlers, level, propagation and filters of every logger it touches.Link to Devin session: https://app.devin.ai/sessions/85c491e543a74ab89151fdf7a0ba5d20
Open in Devin Desktop: https://app.devin.ai/desktop/session/85c491e543a74ab89151fdf7a0ba5d20?variant=devin
Requested by: Caleb Evans (@calebevans-ab)