/** * @since 2.0.0 */ import type * as Duration from "./Duration.js"; import type * as Equal from "./Equal.js"; import type * as MetricBoundaries from "./MetricBoundaries.js"; import type * as MetricKeyType from "./MetricKeyType.js"; import type * as MetricLabel from "./MetricLabel.js"; import type * as Option from "./Option.js"; import type { Pipeable } from "./Pipeable.js"; import type * as Types from "./Types.js"; /** * @since 2.0.0 * @category symbols */ export declare const MetricKeyTypeId: unique symbol; /** * @since 2.0.0 * @category symbols */ export type MetricKeyTypeId = typeof MetricKeyTypeId; /** * A `MetricKey` is a unique key associated with each metric. The key is based * on a combination of the metric type, the name and tags associated with the * metric, an optional description of the key, and any other information to * describe a metric, such as the boundaries of a histogram. In this way, it is * impossible to ever create different metrics with conflicting keys. * * @since 2.0.0 * @category models */ export interface MetricKey> extends MetricKey.Variance, Equal.Equal, Pipeable { readonly name: string; readonly keyType: Type; readonly description: Option.Option; readonly tags: ReadonlyArray; } /** * @since 2.0.0 */ export declare namespace MetricKey { /** * @since 2.0.0 * @category models */ type Untyped = MetricKey; /** * @since 2.0.0 * @category models */ type Counter = MetricKey>; /** * @since 2.0.0 * @category models */ type Gauge = MetricKey>; /** * @since 2.0.0 * @category models */ type Frequency = MetricKey; /** * @since 2.0.0 * @category models */ type Histogram = MetricKey; /** * @since 2.0.0 * @category models */ type Summary = MetricKey; /** * @since 2.0.0 * @category models */ interface Variance { readonly [MetricKeyTypeId]: { _Type: Types.Covariant; }; } } /** * @since 2.0.0 * @category refinements */ export declare const isMetricKey: (u: unknown) => u is MetricKey>; /** * Creates a metric key for a counter, with the specified name. * * @since 2.0.0 * @category constructors */ export declare const counter: { /** * Creates a metric key for a counter, with the specified name. * * @since 2.0.0 * @category constructors */ (name: string, options?: { readonly description?: string | undefined; readonly bigint?: false | undefined; readonly incremental?: boolean | undefined; }): MetricKey.Counter; /** * Creates a metric key for a counter, with the specified name. * * @since 2.0.0 * @category constructors */ (name: string, options: { readonly description?: string | undefined; readonly bigint: true; readonly incremental?: boolean | undefined; }): MetricKey.Counter; }; /** * Creates a metric key for a categorical frequency table, with the specified * name. * * @since 2.0.0 * @category constructors */ export declare const frequency: (name: string, options?: { readonly description?: string | undefined; readonly preregisteredWords?: ReadonlyArray | undefined; } | undefined) => MetricKey.Frequency; /** * Creates a metric key for a gauge, with the specified name. * * @since 2.0.0 * @category constructors */ export declare const gauge: { /** * Creates a metric key for a gauge, with the specified name. * * @since 2.0.0 * @category constructors */ (name: string, options?: { readonly description?: string | undefined; readonly bigint?: false | undefined; }): MetricKey.Gauge; /** * Creates a metric key for a gauge, with the specified name. * * @since 2.0.0 * @category constructors */ (name: string, options: { readonly description?: string | undefined; readonly bigint: true; }): MetricKey.Gauge; }; /** * Creates a metric key for a histogram, with the specified name and boundaries. * * @since 2.0.0 * @category constructors */ export declare const histogram: (name: string, boundaries: MetricBoundaries.MetricBoundaries, description?: string) => MetricKey.Histogram; /** * Creates a metric key for a summary, with the specified name, maxAge, * maxSize, error, and quantiles. * * @since 2.0.0 * @category constructors */ export declare const summary: (options: { readonly name: string; readonly maxAge: Duration.DurationInput; readonly maxSize: number; readonly error: number; readonly quantiles: ReadonlyArray; readonly description?: string | undefined; }) => MetricKey.Summary; /** * Returns a new `MetricKey` with the specified tag appended. * * @since 2.0.0 * @category constructors */ export declare const tagged: { /** * Returns a new `MetricKey` with the specified tag appended. * * @since 2.0.0 * @category constructors */ (key: string, value: string): >(self: MetricKey) => MetricKey; /** * Returns a new `MetricKey` with the specified tag appended. * * @since 2.0.0 * @category constructors */ >(self: MetricKey, key: string, value: string): MetricKey; }; /** * Returns a new `MetricKey` with the specified tags appended. * * @since 2.0.0 * @category constructors */ export declare const taggedWithLabels: { /** * Returns a new `MetricKey` with the specified tags appended. * * @since 2.0.0 * @category constructors */ (extraTags: ReadonlyArray): >(self: MetricKey) => MetricKey; /** * Returns a new `MetricKey` with the specified tags appended. * * @since 2.0.0 * @category constructors */ >(self: MetricKey, extraTags: ReadonlyArray): MetricKey; }; //# sourceMappingURL=MetricKey.d.ts.map