Add MLFLOW_EXPERIMENT_IS_GATEWAY tag to gateway experiments#21149
Add MLFLOW_EXPERIMENT_IS_GATEWAY tag to gateway experiments#21149TomeHirata merged 1 commit intomlflow:masterfrom
Conversation
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
🛠 DevTools 🛠
Install mlflow from this PRFor Databricks, use the following command: |
There was a problem hiding this comment.
Pull request overview
Adds a new experiment tag to identify experiments created for MLflow AI Gateway usage tracking, enabling downstream consumers (UI/filters/analytics) to reliably detect “gateway experiments”.
Changes:
- Introduce
MLFLOW_EXPERIMENT_IS_GATEWAY = "mlflow.experiment.isGateway"in the shared tags module. - Set
mlflow.experiment.isGateway = "true"when the gateway store auto-creates an experiment during endpoint create/update. - Extend the existing SQL store test to assert the new tag on auto-created experiments.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
mlflow/utils/mlflow_tags.py |
Adds a constant for the new experiment tag key. |
mlflow/store/tracking/gateway/sqlalchemy_mixin.py |
Applies the new tag during gateway experiment auto-creation in create/update flows. |
tests/store/tracking/test_gateway_sql_store.py |
Verifies the new tag is present on an auto-created experiment. |
| tags=[ | ||
| ExperimentTag(MLFLOW_EXPERIMENT_SOURCE_TYPE, "GATEWAY"), | ||
| ExperimentTag(MLFLOW_EXPERIMENT_SOURCE_ID, endpoint_id), | ||
| ExperimentTag(MLFLOW_EXPERIMENT_IS_GATEWAY, "true"), | ||
| ], |
There was a problem hiding this comment.
🟡 MODERATE: This PR adds the mlflow.experiment.isGateway tag when update_gateway_endpoint() auto-creates an experiment, but there’s no test exercising the update flow where usage_tracking is enabled and an experiment is created implicitly. Adding a unit/integration test for that scenario would prevent regressions and verify the new tag (and existing sourceType/sourceId) are set correctly.
|
Documentation preview for 07b8419 is available at: More info
|
|
@TomeHirata Can you update the PR description and explain why we need to add this? |
harupy
left a comment
There was a problem hiding this comment.
LGTM once #21149 (comment) is addressed!
|
@WeichenXu123 No need to add another stamp to a PR that’s already been approved. |
…1149) Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
…1149) Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Related Issues/PRs
n/a
What changes are proposed in this pull request?
Currently mlflow doesn't return null value when negative filter is used for experiment tags. And because of it, we cannot exclude gateway experiments with sourceType tag since most experiments don't have this tag.
How is this PR tested?
Does this PR require documentation update?
Does this PR require updating the MLflow Skills repository?
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.