UNPKG

nestjs-otel

Version:
21 lines (20 loc) 1.49 kB
import { type Counter, type Gauge, type Histogram, type ObservableCounter, type ObservableGauge, type ObservableUpDownCounter, type UpDownCounter } from "@opentelemetry/api"; import type { OtelMetricOptions } from "../interfaces/metric-options.interface"; export type GenericMetric = Counter | UpDownCounter | Histogram | Gauge | ObservableGauge | ObservableCounter | ObservableUpDownCounter; export declare enum MetricType { Counter = "Counter", UpDownCounter = "UpDownCounter", Histogram = "Histogram", Gauge = "Gauge", ObservableGauge = "ObservableGauge", ObservableCounter = "ObservableCounter", ObservableUpDownCounter = "ObservableUpDownCounter" } export declare const meterData: Map<string, GenericMetric>; export declare function getOrCreateHistogram(name: string, options?: OtelMetricOptions): Histogram; export declare function getOrCreateCounter(name: string, options?: OtelMetricOptions): Counter; export declare function getOrCreateGauge(name: string, options?: OtelMetricOptions): Gauge; export declare function getOrCreateUpDownCounter(name: string, options?: OtelMetricOptions): UpDownCounter; export declare function getOrCreateObservableGauge(name: string, options?: OtelMetricOptions): ObservableGauge; export declare function getOrCreateObservableCounter(name: string, options?: OtelMetricOptions): ObservableCounter; export declare function getOrCreateObservableUpDownCounter(name: string, options?: OtelMetricOptions): ObservableUpDownCounter;