Skip to content

Instrument the Metaflow Client to trace metadata requests #4

Description

@valayDave

When an AI agent (or any program) uses the Metaflow Client API, it triggers a chain of HTTP requests to the metadata service. For example, finding all failed tasks in a run requires iterating Run → Steps → Tasks — but it is currently not possible to know, without external tooling, how many requests this generates or how the count scales with run size.

The MetadataProvider base class is the single choke point through which all client queries flow via the get_object() method. Adding optional request tracing here would give a precise, per-operation count of API calls made by any client operation, enabling systematic measurement of client-side efficiency.

Goals

  • Add an opt-in tracing mode to MetadataProvider that records: request count, object type requested, and hierarchy depth for each call to get_object()
  • Verify the tracer captures all requests for a complete Run → Steps → Tasks traversal
  • Document the interface clearly so it can be used by benchmark scripts in a follow-up issue

Instructions

This issue is a venue for questions and design discussion. The implementation should be non-breaking — tracing is disabled by default and has no effect on normal usage.

Spin up the dev stack (see Resources) and run a flow against your local service before starting, so you have real data to trace against.

When you have met the goals, show your work via a fork with an issue / PRs explaining your work. You can add comments with what you achieve on the issue thread. You can reference the Fork/PR/issue in this issue.

Resources

Dev stack:

  • Setting Up the Dev Stack — run metaflow-dev up to get a full local environment (metadata service, DB, UI); use metaflow-dev shell to get a pre-configured shell pointing at it
  • Once running, execute flows against your local stack from within the metaflow-dev shell — real data is needed to trace requests against

Key code:

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