Skip to content

MetricBuilder

Defined in: builder/metric.ts:56

A builder for defining a metric in the Alpyne system.

readonly dimensions: Record<string, { dimension: MetricDimensionBuilder; handler: MetricDimensionHandler; }>

Defined in: builder/metric.ts:57


readonly prn: string

Defined in: builder/index.ts:32

BaseBuilder.prn

addDimension(dimension, position, handler): this

Defined in: builder/metric.ts:70

Adds a dimension to this metric. Dimensions are a means of breaking down and bucketing the metric when it is being queried.

All dimensions boil down to a string value. Each dimension has a handler that converts a single event into the given dimension. A read runtime is provided to allow broader interrogation of the context of the event.

The limit on the number of dimensions is defined in LIMIT-11.

MetricDimensionBuilder

1 | 2 | 3 | 4

MetricDimensionHandler

this

https://www.notion.so/pynhq/Maximum-Number-of-Metric-Dimensions-9b46ec300cd24eecbb688aefe35556ae?pvs=4


addEvent(event, handler?): this

Defined in: builder/metric.ts:81

Adds an event to this metric. The handler calculates the value for this event. For example if it was a CPU usage event it may emit the load level “0.1”.

If the handler is not supplied, all events map to “1” and thus it is simply a count of events. This is expected to be the most common case.

EventBuilder

MetricCalculationHandler

this


addGrant(role): MetricGrant

Defined in: builder/metric.ts:86

Grants the supplied App Role access to this metric.

AppRoleBuilder

MetricGrant


setDescription(description): this

Defined in: builder/index.ts:33

string

this

BaseBuilder.setDescription