[Vercel #1] Prep for adding more integrations#18400
Conversation
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
| "@types/node": "^20.4.5", | ||
| "@typescript-eslint/eslint-plugin": "^6.21.0", | ||
| "@typescript-eslint/parser": "^6.21.0", | ||
| "openai": "^4.0.0", |
There was a problem hiding this comment.
Why did we have openai in the core package dep previously?
There was a problem hiding this comment.
I don't recall a particular reason, but most likely me didn't understand the Typescript packaging system well
There was a problem hiding this comment.
Pull Request Overview
This PR prepares the codebase for adding Vercel AI integration by refactoring core tracing logic to be more flexible and introducing shared test utilities. The changes focus on improving span lifecycle management, adding message format tracking, and consolidating test infrastructure.
Key changes:
- Introduced
MESSAGE_FORMATattribute to distinguish between different LLM integration formats (e.g., OpenAI, Vercel AI) - Refactored span registration to occur in
MlflowSpanProcessorinstead of at span creation time - Created shared OpenAI test helper utilities to reduce code duplication across integrations
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/typescript/integrations/openai/src/index.ts | Added MESSAGE_FORMAT attribute to OpenAI spans |
| libs/typescript/integrations/openai/tests/index.test.ts | Migrated to shared OpenAI test helper utilities |
| libs/typescript/integrations/openai/package.json | Updated peer dependencies to more flexible version constraints |
| libs/typescript/integrations/helpers/openaiTestHelper.ts | Created shared MSW server setup and test utilities for OpenAI mocking |
| libs/typescript/core/src/exporters/mlflow.ts | Moved span registration to processor and added auto-OK status handling |
| libs/typescript/core/src/core/trace_manager.ts | Made getSpan parameters nullable for safer usage |
| libs/typescript/core/src/core/entities/span.ts | Added mutation capability for ended spans and refactored attribute setting |
| libs/typescript/core/src/core/constants.ts | Added MESSAGE_FORMAT constant for tracking integration formats |
| libs/typescript/core/src/core/api.ts | Refactored span creation to defer registration to processor |
| libs/typescript/core/package.json | Removed unused OpenAI dependency from core package |
Files not reviewed (1)
- libs/typescript/package-lock.json: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
🥞 Stacked PR
Use this link to review incremental changes.
What changes are proposed in this pull request?
This is the prep PR for adding Vercel AI integration. Mostly minor tweaks to the core tracing logic to make it flexible enough to support vercel AI.
How is this PR tested?
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/tracking: Tracking Service, tracking client APIs, autologgingarea/models: MLmodel format, model serialization/deserialization, flavorsarea/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registryarea/scoring: MLflow Model server, model deployment tools, Spark UDFsarea/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflowsarea/gateway: MLflow AI Gateway client APIs, server, and third-party integrationsarea/prompts: MLflow prompt engineering features, prompt templates, and prompt managementarea/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionalityarea/projects: MLproject format, project running backendsarea/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/build: Build and test infrastructure for MLflowarea/docs: MLflow documentation pagesHow should the PR be classified in the release notes? Choose one:
rn/none- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/breaking-change- The PR will be mentioned in the "Breaking Changes" sectionrn/feature- A new user-facing feature worth mentioning in the release notesrn/bug-fix- A user-facing bug fix worth mentioning in the release notesrn/documentation- A user-facing documentation change worth mentioning in the release notesShould this PR be included in the next patch release?
Yesshould be selected for bug fixes, documentation updates, and other small changes.Noshould be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.What is a minor/patch release?
Bug fixes, doc updates and new features usually go into minor releases.
Bug fixes and doc updates usually go into patch releases.