Problem
As Lyft grew, products launched and people moved between teams, so different teams began to use different definitions of the same metric. Without version control or a shared standard, outdated definitions crept into decision-making. To find the right definition, people searched codebases or asked colleagues who remembered it.
Example from the article: asked what "Metric ABC" meant, a team would answer differently depending on the context and application it had in mind.
Solution in brief
Lyft built a Metric Semantic Layer (MSL): a versioned Python package that stores each shared metric once, as a YAML config with a plain-English description and a SQL template. Only "Golden Metrics" (at least two distinct uses) are admitted, and each has a business owner and an operational owner who must both approve changes. A Python API, a data catalog, a self-service UI and an MCP server for AI agents read the same configs.
Questions this case answers
- How to keep one governed definition of each business metric when many teams and tools reimplement it independently and definitions drift
- How to assign ownership of shared metric definitions so they stay current through team rotations and attrition
- How to give LLM agents a deterministic source of metric logic so natural-language questions return consistent SQL
- How to give every team one authoritative definition of each product metric and keep it in sync with dashboards, ML models and pipelines?
Tools and methods
- YAML metric configs — owners, data sources, dimensions, granularities, metric expressions
- Jinja SQL templates — one SQL block shared across definitions (DRY, lower learning curve than other templating frameworks)
- Golden Metrics rule and two-owner model — what enters the package and who maintains it
- Python package with
get_sql— ready SQL for a metric, dimensions and date range - Amundsen — catalog with definitions, owners and data quality information
- Metrics MCP server — search and query tools for AI agents, with authorization and evaluation
Google or a one-time email code. No password.