A metric is a definition of how to measure an outcome for each user. Kerf computes metrics in your warehouse, so there is a single copy of your data and one definition of every number.
Connect your warehouse
Under Warehouse Sync, add a connection to Snowflake, BigQuery, Redshift or Databricks. Kerf needs read access to your event tables and write access to a scratch schema.
Define a metric
kerf.metrics.create({
key: "orders_per_visitor",
type: "rate",
numerator: "SELECT user_id, COUNT(*) FROM orders GROUP BY 1",
denominator: "visitors",
window: "14 days",
});Goals and guardrails
A goal is a metric you want to improve. A guardrail is a metric that must not get worse. Both use the same definitions. Guardrails run a non-inferiority test with a tolerance you set.
Variance reduction
Turn on CUPED to use each user's pre-experiment behavior to reduce noise. It usually shortens tests by 20 to 50% on metrics with stable history.
Quality checks
- Sample ratio mismatch blocks the readout when bucketing looks wrong.
- Outlier handling caps extreme values at a percentile you choose.
- Late arriving events are re-read for a set period before results finalize.
Naming
Give every metric an owner and a one sentence description. A metric with no owner tends to be defined three different ways within a year.