Skip to content

Metric

A Metric is a named measure computed from Events or Entries, always derived and never typed in.

Key Results, Experiments and Dashboards read the same Metric, so one number means one thing.

Properties

PropertyTypeRequiredDescription
querytextrequiredHow it is computed. An agent never varies the Metrics it is judged by. Never randomized.
unitstringThe unit, such as dollars or percent.
statusstringrequiredOne of draft or defined.

Object

JSON
{
  "$id": "https://api.sb/kilnbakery.com/metrics/metric_1",
  "$type": "Metric",
  "query": "Example query",
  "unit": "Example unit",
  "status": "draft"
}

Relationships

  • A Metric is computed from many Events: a Metric derives from Events and is never typed in. computedFrom, inverse feeds.
  • A Metric is computed under many Policies: a Policy rules how Metrics are computed, such as revenue under revenue recognition. computedUnder, inverse computes.
  • A Metric is informed by many Surveys: Survey answers compute Metrics, such as a satisfaction score. informedBy, inverse informs.
  • A Metric is measured by many Experiments: one primary Metric judges an Experiment’s Variants; guardrail Metrics stop it. measuredBy, inverse measures.
  • A Metric is moved by many Plays: a Play exists to move named Metrics, read before and after every run. movedBy, inverse moves.
  • A Metric read by many Key Results: a Key Result compares one Metric’s value against its baseline and target. readBy, inverse reads.
  • A Metric is shown on many Dashboards: a Dashboard reads out Metrics, each computed from Events and never typed in. shownOn, inverse shows.

Lifecycle

Metric lifecycle: draft, defined (ends)draft → defined: Metric.definedraftdefined
StateMeaningMoves to
draft (first)Its query is written and not compiled, so nothing reads it.defined by Metric.define
definedIts query compiles against the Startup’s Events and Entries; defining it again recompiles an edited query.None: it ends here.

Verbs

  1. createCreates a Metric.
    POST /{namespace}/metricsdoMetric.created
  2. getReturns one Metric by id.
    GET /{namespace}/metrics/{id}readNo Event
  3. listReturns Metrics, newest first, one page at a time.
    GET /{namespace}/metricsreadNo Event
  4. updateChanges the given properties of a Metric.
    PATCH /{namespace}/metrics/{id}doMetric.updated
  5. deleteDeletes a Metric; its history is kept.
    DELETE /{namespace}/metrics/{id}doMetric.deleted
  6. defineDefine compiles a Metric’s query against the Startup’s Events and Entries and lists every Event it reads.
    POST /{namespace}/metrics/definedoMetric.defined
  7. queryQuery reads Metrics or Events as a trend, funnel, retention curve, path or lifecycle, broken down by any property.
    POST /{namespace}/metrics/querydoMetric.queried
  8. watchWatch alerts the owner of a Metric when it crosses a threshold, by a Task or a Message.
    POST /{namespace}/metrics/{metric}/watchdoMetric.watched

Permissions

Which Access level may call each Verb. One-way Verbs wait their delay window.

Operationowneradminmemberviewer
Metric.createYesYesYesNo
Metric.getYesYesYesYes
Metric.listYesYesYesYes
Metric.updateYesYesYesNo
Metric.deleteYesYesYesNo
Metric.defineYesYesYesNo
Metric.queryYesYesYesNo
Metric.watchYesYesYesNo

Call it

Text
Define the latest metric.

Example

Monthly recurring revenue is a Metric whose query sums active Subscription Entries, with unit: USD. A pricing Experiment, the revenue Dashboard and the annual Key Result all read that one value.