Skip to content

Benchmark agentic query scenarios against the current metadata service #6

Description

@valayDave

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:

  1. Failed task discovery — find all failed tasks in a run, at varying parallelism (e.g. 5 / 50 / 200 parallel tasks)
  2. Log retrieval — fetch the stderr of a failed task; record total bytes transferred vs. actual error content size
  3. 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
  4. 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
  5. 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 Stackmetaflow-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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    gsocGoogle Summer of Code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions