Repository navigation
feat(mcp): use fixed Cloud error message as Datadog span error.message - #1356
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/1791617171-span-cloud-error-message' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791617171-span-cloud-error-message'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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c17102ca06
ℹ️ 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".
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-no-credsThe overall line coverage in commit b4e7dd1 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall line coverage in commit b4e7dd1 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytest-unitThe overall line coverage in commit b4e7dd1 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: dc2090ea90
ℹ️ 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".
|
Codex (@codex) review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 366bbf93b0
ℹ️ 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".
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Codex (@codex) review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
9a8cc2c
into
release-candidate/v1
Summary
TL;DR: failed Cloud tool calls now show in Datadog the same fixed message the agent gets, plus the Cloud endpoint that failed, with no IDs or query strings.
initializeandtools/liststop going to LLM Obs and stay plain APM spans.1. Fixed Cloud
error.messagesdk_error_message(error: SDKError) -> strinapi_utilpicks the message for anSDKError: actor-not-ready, then 403 (FORBIDDEN_RESOURCE_MESSAGE), thendescribe_cloud_error._wrap_sdk_errornow uses it, with no change in behavior.cloud_error_trace_message(error)walks the exception chain. It returns the fixed message for the first of these it finds, andNoneif there is none:AirbyteCloudApiError;SDKError;AirbyteErrorraised fromrequests.HTTPErrorby_make_config_api_request, whose message is already the fixed catalog text._exception_attributessetserror.messagewhile the exception is still available, in the intent middleware. FastMCP then turns the exception into a returnedCallToolResult(isError=True). The outer request middleware sets thetool resulted in an error (...)summary only when noerror.messageis set yet.2. Failing Cloud endpoint (new, native Datadog backend only)
cloud_error_route(error) -> tuple[str, str] | Nonereads the firstSDKError'sraw_response.requestand keeps only the URL path, so host, credentials, query and fragment are dropped.GET/POST/PUT/PATCH/DELETEgiveNone.v<N>version segment becomes{id}, so a customapi_rootprefix never shows. With no version segment, every segment becomes{id}._CLOUD_API_ROUTE_SEGMENTS(the literal segments of theairbyte_apipath templates). Everything else becomes{id}.None.airbyte.mcp.upstream.method/.route, and as LLM Obs metadata.3. Lifecycle requests leave LLM Obs (new)
initializeandtools/listnow usetracer.trace("mcp.<method>", resource="server_request")instead ofLLMObs.task._dd.measuredmetric and the error/outcome attributes.LLMObs.annotate, so no lifecycle input or output is recorded.tools/liststored the whole tool list, about 105 KB.Safety:
error.messageis only fixed text fromcloud_errors.yaml, or a constant. It never contains Cloud'sdetail,data.message, rawtitle, the guidance half (which can include Cloud's error ID), or anything else from the response body.error.messageanderror.stackstay out of LLM Obs metadata.Tests:
tests/unit_tests/test_mcp_datadog.py:api_rootprefixes (including ones that contain allowlisted words) and paths with no version all become{id}; URLs with credentials or a query string are cleaned; a missing request, a non-SDK error or an unsupported method givesNone;None;server_requestand no LLM Obs event.Unchanged: agent-facing text, tool-filter rejections and non-Cloud exceptions. The OTel/
datadog-otlpbackend sets no error text or route today, since its error attributes come from fastmcp-extensions.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)
Important
Auto-merge enabled.
This PR is set to merge automatically when all requirements are met.