Interface CalculatedSummaryOptions<T>

Create tracked metrics that are expensive to calculate by passing a function that is only invoked when metrics are being scraped

interface CalculatedSummaryOptions<T> {
    ageBuckets?: number;
    calculate: CalculateMetric<T>;
    compressCount?: number;
    help?: string;
    label?: string;
    maxAgeSeconds?: number;
    percentiles?: number[];
    pruneAgedBuckets?: boolean;
}

Type Parameters

  • T = number

Hierarchy (view full)

Properties

ageBuckets?: number

Configure how many buckets in the sliding window

calculate: CalculateMetric<T>

An optional function invoked to calculate the component metric instead of using .observe

compressCount?: number

Control compression of data in t-digest

help?: string

Optional help for the metric

label?: string

Optional label for the metric

maxAgeSeconds?: number

Configure how old a bucket can be before it is reset for sliding window

percentiles?: number[]

Percentiles for the summary

pruneAgedBuckets?: boolean

Remove entries without any new values in the last maxAgeSeconds