Schema.Union<
readonly [typeof CounterDatum, typeof GaugeDatum, typeof HistogramDatum]
>One metric from a node's registry, tagged by kind. Frequency/Summary are deferred.
wire schemas
Source src/Telemetry.ts:1181 lines
export const const metricDatum: Schema.Union<
readonly [
typeof CounterDatum,
typeof GaugeDatum,
typeof HistogramDatum
]
>
const metricDatum: {
Type: { [K in keyof Members]: Members[K]["Type"]; }[number];
Encoded: { [K in keyof Members]: Members[K]["Encoded"]; }[number];
DecodingServices: { [K in keyof Members]: Members[K]["DecodingServices"]; }[number];
EncodingServices: { [K in keyof Members]: Members[K]["EncodingServices"]; }[number];
Iso: { [K in keyof Members]: Members[K]["Iso"]; }[number];
members: Members;
mapMembers: (f: (members: readonly [typeof CounterDatum, typeof GaugeDatum, typeof HistogramDatum]) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Union<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<CounterDatum | GaugeDatum | HistogramDatum, readonly []>) => Schema.Union<readonly [typeof CounterDatum, typeof GaugeDatum, typeof HistogramDatum]>;
annotateKey: (annotations: Schema.Annotations.Key<CounterDatum | GaugeDatum | HistogramDatum>) => Schema.Union<readonly [typeof CounterDatum, typeof GaugeDatum, typeof HistogramDatum]>;
check: (checks_0: Check<CounterDatum | GaugeDatum | HistogramDatum>, ...checks: Array<Check<CounterDatum | GaugeDatum | HistogramDatum>>) => Schema.Union<readonly [typeof CounterDatum, typeof GaugeDatum, typeof HistogramDatum]>;
rebuild: (ast: Union<Declaration>) => Schema.Union<readonly [typeof CounterDatum, typeof GaugeDatum, typeof HistogramDatum]>;
make: (input: CounterDatum | GaugeDatum | HistogramDatum, options?: Schema.MakeOptions) => CounterDatum | GaugeDatum | HistogramDatum;
makeOption: (input: CounterDatum | GaugeDatum | HistogramDatum, options?: Schema.MakeOptions) => Option<CounterDatum | GaugeDatum | HistogramDatum>;
makeEffect: (input: CounterDatum | GaugeDatum | HistogramDatum, options?: Schema.MakeOptions) => Effect.Effect<CounterDatum | GaugeDatum | HistogramDatum, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
One metric from a node's registry, tagged by kind. Frequency/Summary are deferred.
metricDatum = import SchemaSchema.function Union<readonly [typeof CounterDatum, typeof GaugeDatum, typeof HistogramDatum]>(members: readonly [typeof CounterDatum, typeof GaugeDatum, typeof HistogramDatum], options?: {
mode?: "anyOf" | "oneOf";
}): Schema.Union<readonly [typeof CounterDatum, typeof GaugeDatum, typeof HistogramDatum]>
Creates a union schema from an array of member schemas. Members are tested in
order; the first match is returned.
Details
Optionally, specify mode:
"anyOf" (default) — matches if any member matches.
"oneOf" — matches if exactly one member matches.
Example (Defining a string or number union)
import { Schema } from "effect"
const schema = Schema.Union([Schema.String, Schema.Number])
Schema.decodeUnknownSync(schema)("hello") // "hello"
Schema.decodeUnknownSync(schema)(42) // 42
Union([class CounterDatumclass CounterDatum {
Type: Self;
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
identifier: string;
fields: S["fields"];
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Counter'>; readonly id: Schema.String; readonly labels: Schema.$Record<Schema.String, Schema.String>; readonly count: Schema.Number }) => To, options?: { readonly unsafePreserveChecks?: boolean | u…;
extend: (identifier: string) => { (fields: NewFields, annotations?: Schema.Annotations.Declaration<Extended, readonly [Schema.Struct<{ [K in keyof { [K in keyof (('id' | 'labels' | 'count' | '_tag') & keyof NewFields extends never ? { readonly _ta…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<CounterDatum, readonly [Schema.TaggedStruct<'Counter', { readonly id: Schema.String; readonly labels: Schema.$Record<Schema.String, Schema.String>; readonly count: Schema.Number }>]>) => Schema.decod…;
annotateKey: (annotations: Schema.Annotations.Key<CounterDatum>) => Schema.decodeTo<Schema.declareConstructor<CounterDatum, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Counter'>; readonly id: Schema.String; readonly labels: Schema.$Record<S…;
check: (checks_0: Check<CounterDatum>, ...checks: Array<Check<CounterDatum>>) => Schema.decodeTo<Schema.declareConstructor<CounterDatum, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Counter'>; readonly id: Schema.String; readonly label…;
rebuild: (ast: Declaration) => Schema.decodeTo<Schema.declareConstructor<CounterDatum, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Counter'>; readonly id: Schema.String; readonly labels: Schema.$Record<Schema.String, Schema.String>; rea…;
make: (input: { readonly id: string; readonly labels: { readonly [x: string]: string }; readonly count: number; readonly _tag?: 'Counter' | undefined }, options?: Schema.MakeOptions) => CounterDatum;
makeOption: (input: { readonly id: string; readonly labels: { readonly [x: string]: string }; readonly count: number; readonly _tag?: 'Counter' | undefined }, options?: Schema.MakeOptions) => Option<CounterDatum>;
makeEffect: (input: { readonly id: string; readonly labels: { readonly [x: string]: string }; readonly count: number; readonly _tag?: 'Counter' | undefined }, options?: Schema.MakeOptions) => Effect.Effect<CounterDatum, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
A counter reading.
CounterDatum, class GaugeDatumclass GaugeDatum {
Type: Self;
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
identifier: string;
fields: S["fields"];
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Gauge'>; readonly id: Schema.String; readonly labels: Schema.$Record<Schema.String, Schema.String>; readonly value: Schema.Number }) => To, options?: { readonly unsafePreserveChecks?: boolean | und…;
extend: (identifier: string) => { (fields: NewFields, annotations?: Schema.Annotations.Declaration<Extended, readonly [Schema.Struct<{ [K in keyof { [K in keyof (('id' | 'labels' | '_tag' | 'value') & keyof NewFields extends never ? { readonly _ta…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<GaugeDatum, readonly [Schema.TaggedStruct<'Gauge', { readonly id: Schema.String; readonly labels: Schema.$Record<Schema.String, Schema.String>; readonly value: Schema.Number }>]>) => Schema.decodeTo<…;
annotateKey: (annotations: Schema.Annotations.Key<GaugeDatum>) => Schema.decodeTo<Schema.declareConstructor<GaugeDatum, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Gauge'>; readonly id: Schema.String; readonly labels: Schema.$Record<Schema.…;
check: (checks_0: Check<GaugeDatum>, ...checks: Array<Check<GaugeDatum>>) => Schema.decodeTo<Schema.declareConstructor<GaugeDatum, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Gauge'>; readonly id: Schema.String; readonly labels: Schem…;
rebuild: (ast: Declaration) => Schema.decodeTo<Schema.declareConstructor<GaugeDatum, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Gauge'>; readonly id: Schema.String; readonly labels: Schema.$Record<Schema.String, Schema.String>; readonl…;
make: (input: { readonly id: string; readonly labels: { readonly [x: string]: string }; readonly value: number; readonly _tag?: 'Gauge' | undefined }, options?: Schema.MakeOptions) => GaugeDatum;
makeOption: (input: { readonly id: string; readonly labels: { readonly [x: string]: string }; readonly value: number; readonly _tag?: 'Gauge' | undefined }, options?: Schema.MakeOptions) => Option<GaugeDatum>;
makeEffect: (input: { readonly id: string; readonly labels: { readonly [x: string]: string }; readonly value: number; readonly _tag?: 'Gauge' | undefined }, options?: Schema.MakeOptions) => Effect.Effect<GaugeDatum, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
A gauge reading.
GaugeDatum, class HistogramDatumclass HistogramDatum {
Type: Self;
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
identifier: string;
fields: S["fields"];
mapFields: (f: (fields: { readonly _tag: Schema.tag<'Histogram'>; readonly id: Schema.String; readonly labels: Schema.$Record<Schema.String, Schema.String>; readonly buckets: Schema.$Array<typeof HistogramBucket>; readonly count: Schema.Number; reado…;
extend: (identifier: string) => { (fields: NewFields, annotations?: Schema.Annotations.Declaration<Extended, readonly [Schema.Struct<{ [K in keyof { [K in keyof (('id' | 'labels' | 'count' | '_tag' | 'buckets' | 'sum') & keyof NewFields extends ne…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<HistogramDatum, readonly [Schema.TaggedStruct<'Histogram', { readonly id: Schema.String; readonly labels: Schema.$Record<Schema.String, Schema.String>; readonly buckets: Schema.$Array<typeof Histogra…;
annotateKey: (annotations: Schema.Annotations.Key<HistogramDatum>) => Schema.decodeTo<Schema.declareConstructor<HistogramDatum, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Histogram'>; readonly id: Schema.String; readonly labels: Schema.$Re…;
check: (checks_0: Check<HistogramDatum>, ...checks: Array<Check<HistogramDatum>>) => Schema.decodeTo<Schema.declareConstructor<HistogramDatum, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Histogram'>; readonly id: Schema.String; readon…;
rebuild: (ast: Declaration) => Schema.decodeTo<Schema.declareConstructor<HistogramDatum, Schema.Struct.ReadonlySide<{ readonly _tag: Schema.tag<'Histogram'>; readonly id: Schema.String; readonly labels: Schema.$Record<Schema.String, Schema.String>;…;
make: (input: { readonly id: string; readonly labels: { readonly [x: string]: string }; readonly count: number; readonly buckets: ReadonlyArray<HistogramBucket>; readonly sum: number; readonly _tag?: 'Histogram' | undefined }, options?: Schema.M…;
makeOption: (input: { readonly id: string; readonly labels: { readonly [x: string]: string }; readonly count: number; readonly buckets: ReadonlyArray<HistogramBucket>; readonly sum: number; readonly _tag?: 'Histogram' | undefined }, options?: Schema.M…;
makeEffect: (input: { readonly id: string; readonly labels: { readonly [x: string]: string }; readonly count: number; readonly buckets: ReadonlyArray<HistogramBucket>; readonly sum: number; readonly _tag?: 'Histogram' | undefined }, options?: Schema.M…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
A histogram reading (cumulative buckets).
HistogramDatum]);
Referenced by 2 symbols