Add linked prompts filter for trace search tab#19192
Add linked prompts filter for trace search tab#19192TomeHirata merged 7 commits intomlflow:masterfrom
Conversation
dbf7cec to
cb36c3f
Compare
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
|
Documentation preview for ede5fcc is available at: More info
|
…tests for prompt filter functionality - Simplified the `canSearchCustomValue` prop in `TableFilterItemValueInput.tsx`. - Updated tests in `useMlflowTraces.test.tsx` to use `FilterOperator.EQUALS` for prompt filters, enhancing clarity and consistency. Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
…d adjust expected lengths Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
| const validFilters = localFilters.filter( | ||
| (filter) => filter.column && filter.value !== undefined && filter.value !== '', | ||
| ); |
There was a problem hiding this comment.
what was the original issue here?
There was a problem hiding this comment.
This is no longer needed, reverted
| filter.push(`request_metadata."mlflow.modelId" = '${networkFilter.value}'`); | ||
| break; | ||
| case LINKED_PROMPTS_COLUMN_ID: | ||
| filter.push(`prompt = '${networkFilter.value}'`); |
There was a problem hiding this comment.
is this supported in databricks? if not, could you add some comment so i remember to handle this in backsync?
alternatively could you test to see if there's some filter key here that works for both databricks and oss?
There was a problem hiding this comment.
It's not supported, let me add comments
daniellok-db
left a comment
There was a problem hiding this comment.
code looks fine but could we check on the databricks compatibility?
…ent for linked prompts filter availability in OSS Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a new "Prompt" filter to the trace search tab, allowing users to filter traces by prompt version. The feature extracts linked prompt information from trace tags (mlflow.linkedPrompts) and displays them as filterable options in the traces table.
Key Changes:
- Added a new "Prompt" column to the traces table with proper internationalization
- Implemented prompt extraction logic from trace tags with JSON parsing and error handling
- Added filter UI components with typeahead support and custom value search
- Comprehensive test coverage for prompt extraction, deduplication, and error handling
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| types.ts | Added optional prompt field to TableFilterOptions interface |
| useTableColumns.tsx | Added LINKED_PROMPTS_COLUMN_ID constant and new "Prompt" column definition |
| useTableColumns.test.tsx | Updated test expectations to account for new "Prompt" column |
| useMlflowTraces.tsx | Added logic to extract and deduplicate prompt options from trace tags; added filter creation for prompt column |
| useMlflowTraces.test.tsx | Added comprehensive tests for prompt extraction, deduplication, invalid JSON handling, and filter creation |
| TableFilterItemValueInput.tsx | Added UI component for prompt filter value input with typeahead |
| TableFilterItem.tsx | Added LINKED_PROMPTS_COLUMN_ID to filterable columns |
| GenAiTracesTableFilter.tsx | Minor formatting change to onClick handler (unnecessary) |
| en.json | Added internationalization entry for "Prompt" column label |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
Related Issues/PRs
n/a
What changes are proposed in this pull request?
Add a new filter to filter traces by prompt version.
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.