Skip to content

refactor: decouple integrations from llmo: vertexai, pydantic_ai, openai_agents - #21622

Draft
emmettbutler wants to merge 1 commit into
mainfrom
emmett.butler/decouple-vertexai-openai-agents-pydantic-ai
Draft

emmettbutler wants to merge 1 commit into
mainfrom
emmett.butler/decouple-vertexai-openai-agents-pydantic-ai

Conversation

@emmettbutler

Copy link
Copy Markdown
Collaborator

No description provided.

@emmettbutler
emmettbutler requested review from a team as code owners November 9, 2026 22:16
@emmettbutler
emmettbutler requested review from Yun-Kim and juanjux and removed request for a team November 9, 2026 22:16
@emmettbutler
emmettbutler marked this pull request as draft November 9, 2026 22:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T22:19:30.638169Z 64c514e PR opened
ℹ️ 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 review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Codeowners resolved as

Resolved from the full PR diff against main using the target branch CODEOWNERS file.
CODEOWNERS team requests not listed below are not required by the current file set.

.agents/skills/llmobs-integrations/references/implementation-guide.md   @DataDog/ml-observability
ddtrace/contrib/internal/openai_agents/_constants.py                    @DataDog/ml-observability
ddtrace/contrib/internal/openai_agents/patch.py                         @DataDog/ml-observability
ddtrace/contrib/internal/pydantic_ai/_constants.py                      @DataDog/ml-observability
ddtrace/contrib/internal/pydantic_ai/patch.py                           @DataDog/ml-observability
ddtrace/contrib/internal/pydantic_ai/utils.py                           @DataDog/ml-observability
ddtrace/contrib/internal/vertexai/_constants.py                         @DataDog/ml-observability
ddtrace/contrib/internal/vertexai/_utils.py                             @DataDog/ml-observability
ddtrace/contrib/internal/vertexai/patch.py                              @DataDog/ml-observability
ddtrace/llmobs/_contrib/openai_agents/__init__.py                       @DataDog/ml-observability
ddtrace/llmobs/_contrib/openai_agents/_processor.py                     @DataDog/ml-observability
ddtrace/llmobs/_contrib/pydantic_ai/__init__.py                         @DataDog/ml-observability
ddtrace/llmobs/_contrib/vertexai/__init__.py                            @DataDog/ml-observability
ddtrace/llmobs/_integrations/openai_agents.py                           @DataDog/ml-observability
ddtrace/llmobs/_integrations/pydantic_ai.py                             @DataDog/ml-observability
ddtrace/llmobs/_integrations/vertexai.py                                @DataDog/ml-observability
mypy.ini                                                                @DataDog/python-guild @DataDog/apm-core-python
pyproject.toml                                                          @DataDog/python-guild
tests/contrib/openai_agents/test_openai_agents_patch.py                 @DataDog/ml-observability
tests/contrib/pydantic_ai/test_pydantic_ai_llmobs.py                    @DataDog/ml-observability
tests/contrib/pydantic_ai/test_pydantic_ai_patch.py                     @DataDog/ml-observability
tests/contrib/vertexai/test_vertexai_patch.py                           @DataDog/ml-observability
tests/snapshots/tests.contrib.pydantic_ai.test_pydantic_ai.test_agent_run.json  @DataDog/apm-core-python @DataDog/apm-python
tests/snapshots/tests.contrib.pydantic_ai.test_pydantic_ai.test_agent_run_error.json  @DataDog/apm-core-python @DataDog/apm-python
tests/snapshots/tests.contrib.pydantic_ai.test_pydantic_ai.test_agent_with_tools.json  @DataDog/apm-core-python @DataDog/apm-python
tests/snapshots/tests.contrib.vertexai.test_vertexai.test_vertexai_completion.json  @DataDog/ml-observability
tests/snapshots/tests.contrib.vertexai.test_vertexai.test_vertexai_completion_error.json  @DataDog/ml-observability
tests/snapshots/tests.contrib.vertexai.test_vertexai.test_vertexai_completion_multiple_messages.json  @DataDog/ml-observability
tests/snapshots/tests.contrib.vertexai.test_vertexai.test_vertexai_completion_stream.json  @DataDog/ml-observability
tests/snapshots/tests.contrib.vertexai.test_vertexai.test_vertexai_completion_stream_error.json  @DataDog/ml-observability
tests/snapshots/tests.contrib.vertexai.test_vertexai.test_vertexai_completion_stream_tool.json  @DataDog/ml-observability
tests/snapshots/tests.contrib.vertexai.test_vertexai.test_vertexai_completion_system_prompt.json  @DataDog/ml-observability
tests/snapshots/tests.contrib.vertexai.test_vertexai.test_vertexai_completion_tool.json  @DataDog/ml-observability

@emmettbutler emmettbutler added the changelog/no-changelog A changelog entry is not required for this PR. label Nov 9, 2026
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

There are 72 dependency direction violations that already exist on the base branch and have not been changed by this PR.

Show existing violations (showing 5 of 72 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=120)
ddtrace.llmobs._integrations.mcp -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)
ddtrace.llmobs._integrations.bedrock -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)
ddtrace.llmobs._integrations.openai_agents -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)
ddtrace.llmobs._telemetry -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)

To see all violations, download the layers-base.json and layers-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/layers.py compare layers-base.json layers-pr.json

✅ Dependency direction violations removed

5 violation(s) have been removed by this PR.

ddtrace.contrib.internal.openai_agents.processor -×-> ddtrace.llmobs._integrations.utils  (contrib -> product:llmobs, score=10)
ddtrace.contrib.internal.vertexai.patch -×-> ddtrace.llmobs._integrations  (contrib -> product:llmobs, score=9)
ddtrace.contrib.internal.vertexai.patch -×-> ddtrace.llmobs._integrations.google_utils  (contrib -> product:llmobs, score=7)
ddtrace.contrib.internal.openai_agents.patch -×-> ddtrace.llmobs._integrations.openai_agents  (contrib -> product:llmobs, score=3)
ddtrace.contrib.internal.pydantic_ai.patch -×-> ddtrace.llmobs._integrations.pydantic_ai  (contrib -> product:llmobs, score=3)

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

✨ Unblock PR with BitsAI

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 3 Pipeline jobs failed

DDCI - DataDog/dd-trace-py | llmobs/vertexai — 🔧 Needs a code fix, caused by this PR

View more details · View in DDCI

DataDog/apm-reliability/dd-trace-py | llmobs/vertexai — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

Changelog | Validate changelog

View more details · View in GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 64c514e | Docs | View more details | Give us feedback!

@datadog-datadog-us1-prod datadog-datadog-us1-prod Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

Pydantic AI streaming, error handling, and tool calls passed focused validation after the move to request events. The full integration and dependency-version matrix remains unverified.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 64c514e

@pr-commenter

pr-commenter Bot commented Nov 9, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-11-09 22:38:32

Comparing candidate commit 64c514e in PR branch emmett.butler/decouple-vertexai-openai-agents-pydantic-ai with baseline commit c78138a in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 626 metrics, 10 unstable metrics, 1 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:coreapiscenario-context_with_data_listeners

  • unstable execution_time [-748.516ns; +657.215ns] or [-6.956%; +6.108%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-39.703ns; +30.455ns] or [-5.680%; +4.357%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1886.173ns; +1820.089ns] or [-9.402%; +9.072%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1658.764ns; +1858.756ns] or [-8.597%; +9.634%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-424.414ns; +291.304ns] or [-9.665%; +6.634%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-198.550ns; +231.538ns] or [-7.310%; +8.524%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-75.874ns; +103.326ns] or [-5.120%; +6.972%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-5085.275ns; +4442.304ns] or [-9.912%; +8.659%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-1069.077ns; +864.498ns] or [-9.779%; +7.907%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-58.351µs; +53.194µs] or [-9.988%; +9.105%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

Known flaky benchmarks without significant changes:

  • scenario:packagespackageforrootmodulemapping-cache_off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog A changelog entry is not required for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant