AI coding agents interacting with Metaflow perform a predictable set of operations: finding failed runs, diagnosing task errors, filtering runs by time window, and searching for artifacts. The metadata service currently handles all of these through generic hierarchical traversal. There is no server-side filtering by status, time range, or artifact properties.
Before any improvements can be made, there needs to be a clear baseline: for each realistic agent scenario, how many API calls are made, how many DB queries are triggered, and how does this scale with the size of the run? The instrumentation introduced in issues #4 and #5 is the measurement layer. This issue is about building the scenarios and running them.
The five scenarios to cover:
- Failed task discovery — find all failed tasks in a run, at varying parallelism (e.g. 5 / 50 / 200 parallel tasks)
- Log retrieval — fetch the stderr of a failed task; record total bytes transferred vs. actual error content size
- Status-filtered run listing — list only failed runs from a flow's history; record how many total runs are fetched to achieve this client-side
- Time-horizon queries — list all runs and tasks within a specific time window (e.g. last 24 hours);
ts_epoch is stored in the DB but is not a filterable parameter at the API level — measure the full traversal cost of doing this today
- Cross-run artifact search — find which runs produced a specific named artifact; record traversal depth and total requests
Goals
Instructions
You will need the dev stack running with test flows at varying scales. Include a setup script or instructions for generating the test data (a flow with N parallel tasks, known failures, predictable artifact names).
This issue is about measurement, not solutions. The output is a results table and a short written analysis of where the worst bottlenecks are.
When you have met the goals, share your benchmark scripts and results table via a fork as a message on this issue thread.
Resources
Dev stack:
- Setting Up the Dev Stack —
metaflow-dev up spins up the full environment; metaflow-dev shell drops you into a shell already configured to talk to it — run your test flows from there to generate benchmark data at varying scales
- Swagger UI at
http://localhost:8080/api/doc — useful for inspecting raw endpoint responses alongside benchmark output
Key code — client side:
Key code — service side:
Docs:
AI coding agents interacting with Metaflow perform a predictable set of operations: finding failed runs, diagnosing task errors, filtering runs by time window, and searching for artifacts. The metadata service currently handles all of these through generic hierarchical traversal. There is no server-side filtering by status, time range, or artifact properties.
Before any improvements can be made, there needs to be a clear baseline: for each realistic agent scenario, how many API calls are made, how many DB queries are triggered, and how does this scale with the size of the run? The instrumentation introduced in issues #4 and #5 is the measurement layer. This issue is about building the scenarios and running them.
The five scenarios to cover:
ts_epochis stored in the DB but is not a filterable parameter at the API level — measure the full traversal cost of doing this todayGoals
Instructions
You will need the dev stack running with test flows at varying scales. Include a setup script or instructions for generating the test data (a flow with N parallel tasks, known failures, predictable artifact names).
This issue is about measurement, not solutions. The output is a results table and a short written analysis of where the worst bottlenecks are.
When you have met the goals, share your benchmark scripts and results table via a fork as a message on this issue thread.
Resources
Dev stack:
metaflow-dev upspins up the full environment;metaflow-dev shelldrops you into a shell already configured to talk to it — run your test flows from there to generate benchmark data at varying scaleshttp://localhost:8080/api/doc— useful for inspecting raw endpoint responses alongside benchmark outputKey code — client side:
metaflow/client/core.py#L2541—Flow.runs(), entry point for scenario 3metaflow/client/core.py#L1549—Task.successful, how failure status is determined todaymetaflow/client/core.py#L1638—Task.stdout/Task.stderr, relevant for scenario 2metaflow/metadata_provider/metadata.py#L352—get_object(), the instrumentation hook from issue Instrument the Metaflow Client to trace metadata requests #4Key code — service side:
services/data/postgres_async_db.py#L248—execute_sql(), the instrumentation hook from issue Instrument the metadata service to trace database queries per request #5services/data/models.py— notets_epochonRunRowandTaskRow, relevant for scenario 4 (time-horizon queries)services/metadata_service/api/task.py— includes the existingfiltered_tasksendpoint; compare its pattern to what scenarios 1 and 3 needDocs: