---
title: "Metric Semantic Layer: How Lyft Governs and Scales Key Data Definitions"
description: "Lyft built a Metric Semantic Layer (MSL), a versioned Python package that stores each company-wide \"Golden Metric\" as YAML metadata plus Jinja-templated SQL, so a definition is updated once and flows to every downstream consumer."
url: "https://swe.quest/articles/metric-semantic-layer-how-lyft-governs-and-scales-key-data-definitions-cb56db8cd5933bc9"
canonical: "https://eng.lyft.com/metric-semantic-layer-how-lyft-governs-and-scales-key-data-definitions-56bee3643c29"
source: "Lyft Engineering"
published: "2026-06-10"
difficulty: "medium"
kind: "Case study"
reading_minutes: 6
tags: ["analytics","data-pipelines","sql","python","ai-agents"]
---

# Metric Semantic Layer: How Lyft Governs and Scales Key Data Definitions

A post on [Lyft Engineering](https://swe.quest/sources/lyft.md), published 2026-06-10, 6 min read, Case study. Original: [https://eng.lyft.com/metric-semantic-layer-how-lyft-governs-and-scales-key-data-definitions-56bee3643c29](https://eng.lyft.com/metric-semantic-layer-how-lyft-governs-and-scales-key-data-definitions-56bee3643c29)

## Summary

Lyft built a Metric Semantic Layer (MSL), a versioned Python package that stores each company-wide "Golden Metric" as YAML metadata plus Jinja-templated SQL, so a definition is updated once and flows to every downstream consumer. Python APIs generate or execute SQL for chosen dimensions and time granularity, and they feed dashboards, Airflow, ML workflows, an Amundsen catalog integration, a no-code Metric UI, and an MCP server that grounds AI agents. Governance admits only metrics with at least two distinct use cases. Each one has a team-level Business Owner for metric health and an Operational Owner for data health, and both must approve every definition change. Lyft is now evaluating a vendor-managed semantic layer to integrate with more BI tools and databases.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [SQL](https://swe.quest/tags/sql.md) (Languages)
- [Python](https://swe.quest/tags/python.md) (Languages)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)

## Prerequisites

- SQL aggregation queries ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- Jinja templating
- data warehouse ETL basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

Metric Semantic Layer, Jinja, YAML, Amundsen, Airflow, Model Context Protocol, Hex

## Related posts

- [Metrics Board: Building an Agent-ready Metrics Layer](https://swe.quest/articles/metrics-board-building-an-agent-ready-metrics-layer-2bc254bb605b6f70.md): Pinterest Engineering · 2026-10-06 · Medium · 10 min read · Analytics & OLAP, Data pipelines, AI agents, Observability
  Pinterest's Metrics Board is a thin semantic layer where each metric is defined once as a YAML spec in Git, with arbitrary SQL plus temporal and modelling metadata, instead of being forced into a strict semantic model.
- [Data Lineage at Slack](https://swe.quest/articles/data-lineage-at-slack-fbf2aa4b9e9054d0.md): Slack Engineering · 2021-08-17 · Medium · 8 min read · Data pipelines, Privacy, Analytics & OLAP
  Slack built a central Data Lineage Service that automatically captures table- and column-level lineage by hooking Airflow success callbacks and dashboard audit logs, then parsing the submitted SQL with ANTLR (backed by a large unit-test suite).
- [DataJunction as Netflix’s answer to the missing piece of the modern data stack](https://swe.quest/articles/datajunction-as-netflix-s-answer-to-the-missing-piece-of-the-modern-data-stack-904d3ac9722fa537.md): Netflix TechBlog · 2026-10-14 · Easy · 7 min read · Analytics & OLAP, Data pipelines, System design, Open source
  Netflix adopted DataJunction (DJ), an open-source semantic layer, to centralize metric and dimension definitions after onboarding a single metric to its experimentation platform took weeks.
- [Beyond the Dashboard: Accelerating Real-Time Intelligence in the Age of AI](https://swe.quest/articles/beyond-the-dashboard-accelerating-real-time-intelligence-in-the-age-of-ai-3e6b170ebab5c71e.md): Booking.com Engineering · 2026-08-27 · Easy · 9 min read · Analytics & OLAP, AI agents, LLMs, Data pipelines
  Booking.com built a "talk to your data" self-serve analytics setup on Snowflake: semantic views define consistent business metrics, dimensions and table relationships, and Snowflake Agents translate natural-language questions into SQL against them.
- [How Meta understands data at scale](https://swe.quest/articles/how-meta-understands-data-at-scale-ab2f3889e09c8113.md): Meta Engineering · 2025-04-28 · Medium · 19 min read · Privacy, Data pipelines, Machine learning, System design
  Meta's Privacy Aware Infrastructure builds data understanding by schematizing every data asset in a canonical Thrift-based format (DataSchema, covering over 100 million schemas across 100+ systems) and annotating fields with a universal privacy taxonomy of semantic types.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
