import { a as noopMeter, i as Meter, n as Gauge, r as Histogram, t as Counter } from "./meter-CY9GTIM8.js"; import { a as SpanContext, c as StartSpanOptions, i as ActiveSpan, l as noopSpan, n as Tracer, o as SpanEventLevel, r as noopTracer, s as SpanLink, t as TracePropagation } from "./tracer-DJWFmYul.js"; //#region src/attributes/attributes.d.ts declare const scopeAttributes: (prefix?: string) => { readonly type: `${string}.scope.type`; readonly main: `${string}.scope.main`; }; declare const MessagingAttributes: { readonly system: "messaging.system"; readonly message: { readonly id: "messaging.message.id"; readonly correlationId: "messaging.message.correlation_id"; readonly causationId: "messaging.message.causation_id"; readonly conversationId: "messaging.message.conversation_id"; readonly bodySize: "messaging.message.body.size"; }; readonly batch: { readonly messageCount: "messaging.batch.message_count"; }; readonly operation: { readonly type: "messaging.operation.type"; }; readonly destination: { readonly name: "messaging.destination.name"; }; }; type AttributeTarget = 'mainSpan' | 'currentSpan' | 'both'; //#endregion //#region src/meters/compositeMeter.d.ts declare const compositeMeter: (...meters: Meter[]) => Meter; //#endregion //#region src/tracers/compositeTracer.d.ts declare const compositeTracer: (...tracers: Tracer[]) => Tracer; //#endregion //#region src/configuration/options.d.ts declare const defaultPrefix: "almanac"; type Sampler = { shouldSample(name: string, attributes?: Record): boolean; }; type ObservabilityConfig = { tracer?: Tracer; meter?: Meter; propagation?: TracePropagation; attributeTarget?: AttributeTarget; attributePrefix?: Prefix; sampler?: Sampler; }; type ObservabilityOptions = { observability?: ObservabilityConfig; }; type ResolvedObservability = { tracer: Tracer; meter: Meter; propagation: TracePropagation; attributeTarget: AttributeTarget; attributePrefix: Prefix; sampler: Sampler; }; declare const alwaysSample: Sampler; declare const neverSample: Sampler; declare const rateSample: (rate: number) => Sampler; declare const resolveObservability: (options?: ObservabilityOptions, parent?: ObservabilityOptions, defaultPfx?: Prefix) => ResolvedObservability; //#endregion //#region src/scopes/scope.d.ts type SetAttributesOptions = { target?: AttributeTarget; }; type ScopeOptions = { attributes?: Record; links?: SpanLink[]; parent?: SpanContext; propagation?: TracePropagation; }; type ObservabilityScope = { setAttributes(attrs: Record, options?: SetAttributesOptions): void; scope(name: string, fn: (child: ObservabilityScope) => Promise, options?: ScopeOptions): Promise; addEvent(name: string, attributes?: Record, level?: SpanEventLevel): void; addLink(link: SpanLink): void; recordException(error: Error | string): void; spanContext(): SpanContext; }; type ScopeObservability = { tracer: Tracer; sampler?: Sampler; attributeTarget?: AttributeTarget; attributePrefix?: string; propagation?: TracePropagation; }; declare const noopScope: ObservabilityScope; declare const ObservabilityScope: (observability: ScopeObservability, factoryOptions?: { defaultAttributes?: Record; }) => { startScope: (name: string, fn: (scope: ObservabilityScope) => Promise, options?: ScopeOptions) => Promise; }; //#endregion //#region src/testing/collectedSpan.d.ts type CollectedSpan = { name: string; attributes: Record; events: { name: string; attributes?: Record; }[]; links: SpanLink[]; exceptions: (Error | string)[]; startOptions: StartSpanOptions; ownContext: { traceId: string; spanId: string; }; }; //#endregion //#region src/testing/collectingMeter.d.ts type CollectedCounter = { name: string; value: number; attributes?: Record; }; type CollectedHistogram = { name: string; value: number; attributes?: Record; }; type CollectedGauge = { name: string; value: number; attributes?: Record; }; type CollectingMeter = Meter & { counters: CollectedCounter[]; histograms: CollectedHistogram[]; gauges: CollectedGauge[]; }; declare const collectingMeter: () => CollectingMeter; //#endregion //#region src/testing/collectingTracer.d.ts type CollectingTracer = Tracer & { spans: CollectedSpan[]; }; declare const collectingTracer: () => CollectingTracer; //#endregion //#region src/testing/meterAssertions.d.ts type CounterAssertions = { hasValue(value: number): CounterAssertions; recordedTimes(n: number): CounterAssertions; recordedValues(values: number[]): CounterAssertions; hasAttribute(key: string, value: unknown): CounterAssertions; hasAttributes(attrs: Record): CounterAssertions; }; type HistogramAssertions = { hasValue(value: number): HistogramAssertions; hasValueAtLeast(min: number): HistogramAssertions; recordedTimes(n: number): HistogramAssertions; recordedValues(values: number[]): HistogramAssertions; hasAttribute(key: string, value: unknown): HistogramAssertions; hasAttributes(attrs: Record): HistogramAssertions; }; type GaugeAssertions = { hasValue(value: number): GaugeAssertions; recordedTimes(n: number): GaugeAssertions; recordedValues(values: number[]): GaugeAssertions; hasAttribute(key: string, value: unknown): GaugeAssertions; hasAttributes(attrs: Record): GaugeAssertions; }; type MeterCollectionAssertions = { haveCounterNamed(name: string): CounterAssertions; haveHistogramNamed(name: string): HistogramAssertions; haveGaugeNamed(name: string): GaugeAssertions; }; declare const assertThatMetrics: (meter: CollectingMeter) => MeterCollectionAssertions; //#endregion //#region src/testing/spanAssertions.d.ts type SpanAssertions = { exists(): SpanAssertions; hasAttribute(key: string, value: unknown): SpanAssertions; hasAttributes(attrs: Record): SpanAssertions; hasParent(ctx: { traceId: string; spanId: string; }): SpanAssertions; hasNoParent(): SpanAssertions; hasPropagation(p: TracePropagation): SpanAssertions; hasCreationLinks(links: { traceId: string; spanId: string; }[]): SpanAssertions; }; type SpanCollectionAssertions = { haveSpanNamed(name: string): SpanAssertions; containSpanNamed(name: string): SpanCollectionAssertions; haveNoSpans(): void; }; declare const assertThatSpan: (span: CollectedSpan | undefined) => SpanAssertions; declare const assertThatSpans: (spans: CollectedSpan[]) => SpanCollectionAssertions; //#endregion //#region src/testing/observabilitySpec.d.ts type ObservabilityTestConfig = { tracer: CollectingTracer; meter: CollectingMeter; propagation: TracePropagation; attributeTarget: AttributeTarget; includeMessagePayloads: boolean; }; type TracingSpecification = (given: (config: ObservabilityTestConfig) => T, config?: Partial) => { when: (fn: (sut: T, config: ObservabilityTestConfig) => unknown) => { then: (assertFn: (result: { sut: T; spans: SpanCollectionAssertions; metrics: MeterCollectionAssertions; }) => void) => Promise; thenThrows: (assertFn: (result: { sut: T; spans: SpanCollectionAssertions; metrics: MeterCollectionAssertions; error: unknown; }) => void) => Promise; }; }; declare const ObservabilitySpec: { for: (config?: Partial) => TracingSpecification; }; //#endregion export { ActiveSpan, AttributeTarget, CollectedCounter, CollectedGauge, CollectedHistogram, CollectedSpan, CollectingMeter, CollectingTracer, Counter, Gauge, Histogram, MessagingAttributes, Meter, MeterCollectionAssertions, ObservabilityConfig, ObservabilityOptions, ObservabilityScope, ObservabilitySpec, ObservabilityTestConfig, ResolvedObservability, Sampler, ScopeObservability, ScopeOptions, SetAttributesOptions, SpanCollectionAssertions, SpanContext, SpanEventLevel, SpanLink, StartSpanOptions, TracePropagation, Tracer, TracingSpecification, alwaysSample, assertThatMetrics, assertThatSpan, assertThatSpans, collectingMeter, collectingTracer, compositeMeter, compositeTracer, neverSample, noopMeter, noopScope, noopSpan, noopTracer, rateSample, resolveObservability, scopeAttributes }; //# sourceMappingURL=index.d.ts.map