Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Registry

Container for all registered metrics

class Registry {
contentType: string;
 
clear(): void;
getMetricsAsArray(): MetricObject[];
getMetricsAsJSON(): Promise<MetricObjectWithValues<MetricValue<string>>[]>;
getSingleMetric<T extends string>(name: string): Metric<T> | undefined;
getSingleMetricAsString(name: string): Promise<string>;
metrics(): Promise<string>;
registerMetric<T extends string>(metric: Metric<T>): void;
removeSingleMetric(name: string): void;
resetMetrics(): void;
setDefaultLabels(labels: Object): void;
 
static merge(registers: Registry[]): Registry;
}

§Properties

§
contentType: string
[src]

Gets the Content-Type of the metrics for use in the response headers.

§Methods

§
clear(): void
[src]

Remove all metrics from the registry

§
getMetricsAsArray(): MetricObject[]
[src]

Get all metrics as objects

§
getMetricsAsJSON(): Promise<MetricObjectWithValues<MetricValue<string>>[]>
[src]

Get all metrics as objects

§
getSingleMetric<T extends string>(name: string): Metric<T> | undefined
[src]

Get a single metric

@param name

The name of the metric

§
getSingleMetricAsString(name: string): Promise<string>
[src]

Get a string representation of a single metric by name

@param name

The name of the metric

§
metrics(): Promise<string>
[src]

Get string representation for all metrics

§
registerMetric<T extends string>(metric: Metric<T>): void
[src]

Register metric to register

@param metric

Metric to add to register

§
removeSingleMetric(name: string): void
[src]

Remove a single metric

@param name

The name of the metric to remove

§
resetMetrics(): void
[src]

Reset all metrics in the registry

§
setDefaultLabels(labels: Object): void
[src]

Set static labels to every metric emitted by this registry

@param labels

of name/value pairs: { defaultLabel: "value", anotherLabel: "value 2" }

§Static Methods

§
merge(registers: Registry[]): Registry
[src]

Merge registers

@param registers

The registers you want to merge together