BEES Functional Trainings · Data & Analytics · Class 5 · Workshop 1

Global Product Telemetry Foundation

Reading material, pre-work, lab brief and post-work of the first Data & Analytics workshop. It explains how a canonical gold layer, a data contract and an orchestration design allow a product that runs in several markets to be compared without erasing the differences that matter, and it documents the files of the Telemetry Harmonization Lab.

About this session

Global Product Telemetry Foundation · Prof. Afonso

Learning objective

By the end of the session, participants should be able to define canonical events and metrics with tenant, market, version, configuration and feature state dimensions, model the gold layer of a medallion architecture with a declared grain and conformed dimensions, specify a data contract and the orchestration of the metric with a single point of calculation, and validate AI-generated schema mappings by reconciling aggregates.

Session strategy

Two-hour online workshop in the standard structure of the program. A retrieval poll connects the session to the recurrence signals of the Kick Off, a thirty-minute briefing covers high-scale orchestration, the gold layer, data contracts, AI-assisted mapping and multi-tenant telemetry, and the facilitator demonstrates on two illustrative markets how a canonical definition of completed order is written once, reconciled with local reports and placed in the orchestration graph. Groups of five or six, with rotating roles of lead, recorder, timekeeper and skeptic, then harmonise the checkout telemetry of five markets of the fictional company Tradeline into a Canonical Metric Spec, using Databricks or DuckDB, and the debrief compares definitions and the differences preserved as extensions.

Session structure

  1. Opening and retrieval poll — 10 min
  2. Concept briefing: orchestration, gold layer, contracts, AI-assisted mapping and telemetry — 30 min
  3. Worked example: two definitions of completed order — 15 min
  4. Break and group formation — 5 min
  5. Telemetry Harmonization Lab — 40 min
  6. Debrief — 15 min
  7. Transfer and post-work — 5 min

1. How to use this material

This material accompanies a two-hour online workshop for the Data & Analytics class of the BEES Functional Trainings, a class that brings together data engineers, analysts, data scientists and machine learning engineers. The workshop is the first of four in the track and prepares the ground for the other three, which build features, validate models and analyse experiments on top of the canonical layer designed here.

Sections 2 to 10 contain the pre-work and the concepts of the briefing. Sections 11 to 14 describe the lab, the files and the templates, and are the reference the groups keep open during the session. Sections 15 and 16 close the cycle with the rubric used in the debrief and the post-work that applies the session to the participant's own context.

The lab uses Tradeline, a fictional B2B ordering marketplace that connects manufacturers, distributors and retailers in Brazil, Mexico, Colombia, South Africa and the Dominican Republic. Tradeline does not exist, and every file of the lab was generated by a script for teaching purposes. The case was built to reproduce situations that are common in multi-market products, and it does not describe the systems or the numbers of any company.

Prerequisites

Intermediate SQL and a validated access to the lab query environment, in Databricks or an equivalent tool. The data engineering lifecycle is assumed and is not reviewed in the session. If access is not available on the day, the lab can be done in DuckDB on a laptop, as described in Section 13.

2. Pre-work

The pre-work takes about fifteen minutes and is done in the week before the session. Its purpose is to bring to the workshop one concrete case from the participant's own work, which is used in the opening poll and in the debrief.

  1. Note an example of a metric whose definition changes across teams, customers or markets in your work, and write in one sentence what changes: the event that counts, the clock, the currency or the population.
  2. Note one friction point in the current orchestration of your pipelines, such as a dependency on another domain that breaks without notice, a backfill that nobody dares to run or a deadline that is often missed.
  3. Validate your access to the query environment, open a notebook and run a simple query. If access fails, install DuckDB on your laptop as the no-login alternative.
  4. Read Sections 3 and 5 of this material.

The examples should not contain confidential names or numbers. A description of the kind of difference is enough for the discussion.

3. Comparable telemetry in a configurable product

A global B2B product grows by accommodating differences between customers and markets. Each market has its own currency, its own time zone, its own regulation and, frequently, its own history of instrumentation, because the events of the checkout flow were defined by the team that launched the product there. The product team then asks a simple question, such as which market converts more orders or whether a new capability increased the completed orders in every market where it was enabled, and discovers that the answer depends on which table is read.

The difficulty has a structural cause. Comparing markets requires that the same quantity is measured in the same way, while the operation of each market requires that local differences are respected. A regulation that only allows an order to be delivered with a fiscal document, for example, is a real constraint of one market, and the local team has good reasons to track it. When the comparison is made by forcing every market into one definition and discarding the local rule, the local team loses information it needs. When each market keeps its own definition, the global comparison is meaningless.

The workshop treats this tension as a design problem with a known structure. The comparable part is expressed as a canonical metric with a declared grain, calculated once in the gold layer. The local part is preserved as documented attributes and extensions of a data contract. The calculation is placed in the orchestration graph at a single point, with an owner, so that no other domain recalculates it with a different logic. Each of these three elements is discussed in the following sections.

The guiding question of the session states the same problem from the standpoint of the data platform: how to build a data, transformation and orchestration foundation that allows customers, tenants and markets to be compared at high scale, without erasing relevant differences and without creating customer-specific pipelines.

4. Transformation and orchestration at scale

In an ELT architecture the raw data is loaded into the platform first and transformed there, which places the calculation of business metrics in the transformation layer rather than in the source systems. Reis and Housley (2022) describe transformation and orchestration as parts of the same lifecycle that runs from generation to serving. At small scale the question is how to write each transformation. At the scale of hundreds or thousands of DAGs maintained by several domains, the more consequential questions are where each metric is calculated, which tables it depends on, how it is recomputed when data arrives late and who answers when two numbers disagree.

Five properties summarise what a high-scale orchestration needs. A task is idempotent when running it twice for the same partition produces the same result, which in practice means overwriting a partition instead of appending to it; without idempotency, a retry after a failure doubles the orders of a day. Reprocessing and backfill require a declared window for late events and a mechanism that recomputes past partitions without touching the others; without them, an order delivered three days after the end of the month never reaches the month in which it was delivered. Cross-domain dependencies need to be explicit and to come with an agreed freshness, otherwise a finance table may silently read a commerce table whose logic has changed. Delivery deadlines tie the critical path of the graph to the time at which a consumer, such as an executive board, needs the data. Ownership and observability, finally, make it possible to know which team answers for each output and to see its freshness, volume and failure history.

These properties do not depend on the orchestration tool. They are design decisions about the graph, and the lab asks the groups to make them for one metric in a graph of 350 DAGs.

5. The medallion architecture and the gold layer

The medallion architecture organises a lakehouse in three layers of increasing refinement. The bronze layer stores the data as it was received, with the source and the load time, so that any later decision can be traced back and reprocessed. The silver layer applies types, removes duplicates, conforms keys and maps local vocabularies to a common one. The gold layer models the data for consumption, in tables designed around business processes and metrics (Databricks, 2025).

The first decision in the gold layer is the grain, that is, the statement of what one row of a fact table represents. Kimball and Ross (2013) place the declaration of the grain before the choice of dimensions and measures, because the dimensions that can be attached to a row and the measures that can be added across rows depend on it. A table of completed orders whose grain is one row per order supports a count of orders and a sum of amounts by any dimension that is true at the order level. A table that mixes rows per order with rows per event produces double counting as soon as someone sums it.

A second decision concerns the number of places where a metric is calculated. When several domains need the same metric, the gold layer should calculate it once and let every domain read it. Recalculating it in each domain reproduces, inside the platform, the divergence between definitions that the gold layer was supposed to remove, with the aggravating factor that the divergent tables now carry names that suggest they are the same.

6. Conformed dimensions and federated governance

A conformed dimension is a dimension that has the same keys, attributes and meaning in every fact table that uses it (Kimball & Ross, 2013). It is the mechanism that allows a measure from Brazil and a measure from South Africa to be placed side by side. In a multi-market product, the dimensions that need to be conformed are typically the market, the tenant, the retailer with its service model, segment and tier, and the date. The date dimension deserves attention because monthly reports are closed in the local calendar of each market while systems record timestamps in different clocks; the conformed date therefore carries both the UTC timestamp and the local business date.

Data mesh, as described by Dehghani (2022), distributes the ownership of analytical data to the business domains and rests on four principles: domain ownership, data as a product, a self-serve data platform and federated computational governance. The principles do not prevent a centralised gold layer for cross-domain metrics. Federated governance is precisely the mechanism by which the domains agree on global standards, such as the canonical list of lifecycle events, the conformed keys and the lineage requirements, while keeping autonomy over the decisions that affect only their own consumers. The balance proposed in the session is that domains own their silver data products, and that cross-domain metrics live in a gold layer with a single owner.

7. Data contracts and schema evolution

A data contract is an agreement between the producer of a dataset and its consumers about the schema, the meaning, the quality and the rules under which the dataset may change. Jones (2023) presents contracts as a way to move the responsibility for data quality towards the producer and to replace silent upstream changes with negotiated ones.

In a multi-market product the contract has a natural structure in two parts. The common core contains the attributes that every market emits with the same name, type and meaning, such as the event, the order, the timestamp in UTC, the market, the tenant, the amount and the currency. The extensions contain optional attributes of one market, documented with the reason they exist and the decisions that depend on them. A fiscal document identifier required by local regulation is a typical extension: it is irrelevant for the global comparison and indispensable for the local operation.

The evolution rules complete the contract. Adding an optional attribute or a new allowed value that consumers can ignore is a compatible change. Renaming or removing a core attribute, changing its type or changing the meaning of an event on which a metric depends is a breaking change, which requires notice, a new major version and a period in which both versions coexist. The template in Section 14 follows this structure.

8. AI-assisted mapping under human review

Mapping a local schema to a canonical model is repetitive work that coding assistants and the assistants embedded in data platforms do quickly. Given the canonical model, the local header and a sample of rows, an assistant proposes which local event corresponds to which canonical event, writes the transformation and suggests tests of uniqueness, completeness and order of events. The practice is still at an early stage in many data teams, and the session treats it as a practice to try with explicit verification.

The proposal of an assistant is a hypothesis about the data. Three errors are frequent in generated mappings: an event with a plausible name is mapped to the wrong state of the lifecycle, a decimal or separator convention of the source is ignored, and a timestamp without an explicit offset is assumed to be in UTC. All three produce code that runs without error and numbers that look reasonable. The verification that exposes them is a reconciliation of counts and amounts by market and month against an independent source, followed by a written explanation of every difference. Huyen (2025) treats the evaluation of model outputs as a core part of engineering applications with foundation models, and the same reasoning applies here: the mapping is accepted when it has been evaluated, and the person who accepts it records the assumptions and keeps the tests in the pipeline.

Data shared with the assistant

Use only the tools approved by BEES and only the synthetic files of the lab. In real work, the sample given to an assistant should not contain personal data or confidential commercial values.

9. Multi-tenant product telemetry

In a configurable product, an event without the context in which it happened cannot be compared with another event. A completed order in a tenant with a premium tier and a new checkout flow enabled is not comparable with a completed order in a tenant without them unless both events say so. Golding (2024) describes tenant context as a cross-cutting concern of multi-tenant SaaS architectures, and the same applies to telemetry: each event needs the attributes that identify the tenant, the market, the service model and tier, the application and configuration versions, the state of the relevant features and, when applicable, the experiment and variant to which the user was exposed.

Exposure logging deserves a specific mention because it is the basis of the experimentation covered in Workshops 3 and 4 of the track. An experiment can only be analysed when the platform records, for each unit, the moment it was exposed to a variant; inferring exposure afterwards from other events introduces bias.

The OpenTelemetry semantic conventions define common names for the attributes of traces, metrics and logs across services (OpenTelemetry, 2024). Agreeing on names before the data exists costs less than mapping them afterwards, which is what the lab asks the groups to do for five markets. Product analytics events, such as those exported by Mixpanel, are joined to the analytical base through a stable key, and personal data is minimised or pseudonymised before reaching the shared layers.

10. Worked example

The facilitator demonstrates the reasoning of the lab on two illustrative markets whose numbers are deliberately small and different from those of the lab. Market A reports 1,000 completed orders in March and Market B reports 800. Read side by side, the numbers suggest that Market A converts 25% more orders. The comparison is false because the two teams count different things.

Market AMarket B
Local event that countspayment_capturedorder_delivered
Timestamp used for the monthServer time in UTCLocal time of the market
Amount reportedNet of discountGross, with the discount in another column
Completed orders reported in March1,000800
Canonical completed orders in March830800

The canonical definition chooses one lifecycle state and one time reference for every market: an order is completed when its delivery is confirmed and it has not been cancelled, and it is attributed to the local business date of the delivery. Applied to Market A, the definition removes 170 orders that were paid and later cancelled before delivery. Applied to Market B, it keeps the count and changes the amount, because the canonical amount is net of discount. The local rule of Market A remains available as an attribute, so the local team can still reproduce its own report from the gold layer.

gold.fct_completed_order · illustrative sketch
SELECT o.order_id,
       o.market,
       o.tenant_id,
       d.local_business_date          AS completed_date,
       o.net_amount_local,
       o.net_amount_local * fx.usd_per_unit AS net_amount_usd,
       o.local_completion_rule        -- extension kept for the local report
FROM silver.order_lifecycle o
JOIN silver.dim_date_local d
  ON d.market = o.market AND d.utc_ts = o.delivered_at_utc
JOIN silver.fx_daily fx
  ON fx.currency = o.currency AND fx.rate_date = d.local_business_date
WHERE o.delivered_at_utc IS NOT NULL
  AND o.cancelled_at_utc IS NULL;

The last step places the metric in the orchestration graph. One DAG owns the fact table, and the tables in other domains that recalculated completed orders with their own logic are rewired to read it and then retired. The example ends with the metric connected to a business indicator, revenue per completed order, which is what allows a difference between markets to be read as impact.

11. The Telemetry Harmonization Lab

Tradeline operates in five markets, and each market instruments the checkout and fulfilment flow differently. The event names and the column names change from file to file, each market reports amounts in its own currency, timestamps come in different formats and clocks, some attributes are missing in some markets, and in one market a local regulatory rule changes the moment at which the local team considers an order completed. The local teams report completed orders and GMV for September and October 2026, each with its own definition, and the regional leadership wants to compare the markets.

Groups of five or six participants work for forty minutes in breakout rooms. One participant leads the discussion, another records the deliverable in the template, a third keeps time and a fourth acts as the skeptic, whose role is to challenge every mapping that has not reconciled. Data engineers lead the silver model and the contract, analysts define the canonical metrics, and data scientists and machine learning engineers check whether the model meets the feature needs by market. Data engineers with orchestration experience lead the reorganisation of the DAG graph.

StepTaskTime
1. Metric and grainDefine the canonical completed order, the time reference that attributes it to a month and the grain of the gold fact table.8 min
2. Dimensions and contractDesign the conformed dimensions and draft the data contract with a common core and extensible attributes.8 min
3. AI-assisted mappingUse the Databricks assistant or another tool approved by BEES to map at least three local schemas to the model and to generate the transformations for the gold layer. Validate the mapping by reconciling aggregates with local_reported_kpis.csv and write the cause of each difference.12 min
4. OrchestrationIn orchestration_graph.csv, find the gold-layer metrics that are calculated twice and propose a reorganisation: where the canonical metric is calculated, which DAGs it depends on, how it is reprocessed and who owns it.8 min
5. Business linkState how the canonical metric connects to revenue per completed order, so that the comparison across markets can be read in terms of impact.4 min
The deliverable is complete when

The local regulatory difference is preserved as a documented attribute rather than eliminated by standardisation, and the canonical metric has a single point of calculation in the gold layer.

When choosing the three schemas for step 3, include markets with different time formats and different currencies, since those are the differences a generated mapping most often gets wrong. A difference that the group cannot explain in the time available is recorded as open in the reconciliation table.

12. Data dictionary

The files below are described as each local team documents its export. The descriptions state formats and meanings declared by the producers; whether the data matches the declaration is part of what the lab checks.

checkout_events_br.csv · Brazil

ColumnDescription
id_eventoEvent identifier
id_pedidoOrder identifier in the Brazilian system
id_clienteLocal retailer key, mapped to the global key in dim_retailer.csv
modelo_atendimentoService model of the retailer
nome_eventoLifecycle event in Portuguese, including the issue and cancellation of the fiscal invoice (nfe_emitida, nfe_cancelada)
data_hora_localLocal date and time, format dd/mm/yyyy HH:MM:SS
valor_liquido_brlOrder amount net of discount, in BRL, with comma as decimal mark
chave_nfeFiscal invoice key, filled only in the invoice issue event

The file uses a semicolon as separator.

checkout_events_mx.csv · Mexico

ColumnDescription
event_id, order_idEvent and order identifiers
retailer_refLocal retailer key
tenant_id, service_modelTenant and service model of the retailer
event_typeLifecycle event in English
event_tsISO 8601 timestamp with offset
amount_mxn, currencyOrder amount net of discount, in MXN

checkout_events_co.csv · Colombia

ColumnDescription
eventProduct analytics event name, exported from the analytics tool
timeUnix time in seconds
distinct_idLocal retailer key used by the analytics tool
$insert_idIdentifier of the event in the analytics tool
properties.order_idOrder identifier
properties.total, properties.currencyOrder amount net of discount, in COP without decimals
properties.app_versionVersion of the application that sent the event

checkout_events_za.csv · South Africa

ColumnDescription
evt_id, ord_refEvent and order identifiers
evtLifecycle event in upper case
occurred_at_utcTimestamp in UTC, ISO 8601 with Z
value_zar_centsOrder amount net of discount, in ZAR cents
tenant, svc_model, customer_codeTenant, service model and local retailer key

checkout_events_do.csv · Dominican Republic

ColumnDescription
pedido, clienteOrder identifier and local retailer key, both with leading zeros
modelo_servicioService model of the retailer
estado, fecha_estadoStatus in Spanish and local date and time of the status change, format yyyy-mm-dd HH:MM
total_bruto_dop, descuento_dopGross order amount and discount, in DOP

Shared files

FileColumnsDescription
dim_retailer.csvretailer_id, market, market_retailer_key, tenant_id, service_model, segment, tierGlobal retailer dimension with the local key used by each market
fx_rates.csvrate_date, currency, usd_per_unit, sourceDaily reference rate, in US dollars per unit of local currency
local_reported_kpis.csvmarket, month, kpi, value, unit, reported_by, local_definitionCompleted orders and GMV reported by each local team for September and October 2026, with the definition each team declares
orchestration_graph.csvdag_id, domain, owner_team, layer, output_table, upstream_dags, schedule_utc, avg_runtime_min, failures_last_30d, sla_deadline_utc, notes350 DAGs of eight domains; upstream_dags is a list separated by semicolons

13. Loading the data

Databricks

Upload the CSV files to a Unity Catalog volume, import databricks_starter_bronze.py as a notebook, set the catalog, the schema and the volume path in the widgets and run it. The notebook lands each file as text in a bronze table, with the source file and the load time, renames the column names that are not valid in Delta tables and shows the distinct event names per market. Typing, deduplication and harmonisation are left for the lab, in silver.

No-login alternative with DuckDB

Install DuckDB, unzip the lab files into a folder and run the starter script from that folder. The script creates the same bronze tables in a local database file.

Terminal
unzip tradeline-telemetry-lab-data.zip
cd tradeline-telemetry-lab
duckdb tradeline.duckdb < starter_duckdb.sql
duckdb tradeline.duckdb   # then query bronze.checkout_events_br and the others

Both starters read every column as text on purpose. Choosing the type of each column is a decision of the silver layer, and the Brazilian file shows why: read with default options, its amounts are parsed incorrectly.

14. Templates

The Canonical Metric Spec is the artifact of the session. It records, for one metric, the business question and the indicator it feeds, the definition with the moment of attribution and the monetary basis, the grain, the conformed dimensions, the local extensions that are preserved, the expected quality checks, the single point of calculation with its upstream DAGs, reprocessing rule and deadline, and the reconciliation record with the cause of every difference. The data contract template follows the structure of Section 7, with a common core, extensions per market, semantics, quality checks, evolution rules and service levels.

Canonical Metric Spec

Markdown template with eight sections, to be filled in the collaborative board or in a shared document.

Download the template (.md)

Data contract

YAML template with the core and extension structure used in the lab.

Download the template (.yaml)

15. Formative rubric

The rubric guides the feedback in the debrief and does not produce a grade.

CriterionProficientDeveloping
Canonical modelComparable definitions with relevant differences preservedStandardisation that erases context
Contract and orchestrationContract with evolution rules, and a metric with a single point of calculation and explicit dependenciesSchema without versioning, or metric duplicated across pipelines
Use of AIMapping validated by reconciliationMapping accepted without verification

A frequent misconception is to create one pipeline per market to absorb each variation of instrumentation. The approach multiplies code, tests and failure points, and it still does not produce a comparable number, because each pipeline encodes its own definition. A canonical layer allows the markets to be compared and keeps the differences that affect decisions as data, in a single pipeline.

16. Post-work

The post-work takes about twenty minutes and transfers the lab to the participant's own context. Choose a real metric whose definition changes across teams, customers or markets, possibly the one noted in the pre-work, and write its Canonical Metric Spec with the definition, grain, required dimensions, local extensions, expected quality, point of calculation in the gold layer, orchestration dependencies and owner. Confidential names and numbers should be left out.

Workshop 2 of the track, on feature engineering and data preprocessing, starts from the canonical layer and the conformed dimensions of this session to discuss missing values and outliers across markets, normalisation, leakage, distribution shift and feature engineering with generative AI.

17. Downloads

All files are synthetic and describe the fictional company Tradeline. The zip contains every file of the table below.

FileContent
tradeline-telemetry-lab-data.zipAll lab files, starters and templates
checkout_events_br.csvBrazil, 15,349 events
checkout_events_mx.csvMexico, 11,119 events
checkout_events_co.csvColombia, 9,973 events
checkout_events_za.csvSouth Africa, 9,521 events
checkout_events_do.csvDominican Republic, 8,079 status changes
dim_retailer.csv2,199 retailers
fx_rates.csvDaily rates of five currencies
local_reported_kpis.csvLocal reports for September and October 2026
orchestration_graph.csv350 DAGs of eight domains
databricks_starter_bronze.pyDatabricks notebook for bronze ingestion
starter_duckdb.sqlDuckDB script for the no-login alternative

18. References

  • Databricks. (2025). What is the medallion lakehouse architecture? Databricks documentation. https://docs.databricks.com/aws/en/lakehouse/medallion
  • Dehghani, Z. (2022). Data mesh: Delivering data-driven value at scale. O'Reilly Media.
  • Golding, T. (2024). Building multi-tenant SaaS architectures. O'Reilly Media.
  • Huyen, C. (2025). AI engineering: Building applications with foundation models. O'Reilly Media.
  • Jones, A. (2023). Driving data quality with data contracts. Packt Publishing.
  • Kimball, R., & Ross, M. (2013). The data warehouse toolkit: The definitive guide to dimensional modeling (3rd ed.). Wiley.
  • OpenTelemetry. (2024). OpenTelemetry semantic conventions. https://opentelemetry.io/docs/specs/semconv/
  • Reis, J., & Housley, M. (2022). Fundamentals of data engineering. O'Reilly Media.