MetricInstance
Provides access to a Metric’s Dimensions and starts queries over its projected contributions.
Remarks
Section titled “Remarks”Metrics are derived entirely from projected Events and are read-only. Projection runs
separately from the write that published an Event, so a Mutation can complete before its
contribution is queryable. Reach a Metric through ctx.apps.<app>.metrics.<key>.
Properties
Section titled “Properties”dimensions
Section titled “dimensions”
readonlydimensions:Record<string,DimensionInstance>
Dimensions declared on the Metric, keyed by their definition key.
readonlyprn:string
PRN identifying this Metric within the definition.
Methods
Section titled “Methods”getDimensionByPrn()
Section titled “getDimensionByPrn()”getDimensionByPrn(
prn):DimensionInstance
Returns the Dimension declared on this Metric with the given PRN.
Parameters
Section titled “Parameters”string
PRN of a Dimension declared on this Metric.
Returns
Section titled “Returns”query()
Section titled “query()”query(
func):MetricQueryBuilder
Starts a query over this Metric’s projected contributions.
Parameters
Section titled “Parameters”Aggregate function the query is opened with.
Returns
Section titled “Returns”A builder to set the focal Dimension, grouping, interval, and period before executing.

