/** * Mock OpenTelemetry Span for testing tracer functionality. * Implements the full Span interface and records all calls for assertion. */ import type { Span, SpanContext, SpanStatus, SpanAttributes, SpanAttributeValue, TimeInput, Exception, Link } from '@opentelemetry/api'; /** * Concrete mock implementing the Span interface. * Chainable methods return `this` to satisfy the `Span` contract. */ export declare class MockSpan implements Span { readonly calls: { setAttribute: Array<{ key: string; value: SpanAttributeValue; }>; setAttributes: Array<{ attributes: SpanAttributes; }>; addEvent: Array<{ name: string; attributes: SpanAttributes | TimeInput | undefined; startTime: TimeInput | undefined; }>; setStatus: Array<{ status: SpanStatus; }>; updateName: Array<{ name: string; }>; end: Array<{ endTime: TimeInput | undefined; }>; recordException: Array<{ exception: Exception; time: TimeInput | undefined; }>; }; /** @returns A fixed span context for test assertions. */ spanContext(): SpanContext; /** Records a single attribute. */ setAttribute(key: string, value: SpanAttributeValue): this; /** Records a batch of attributes. */ setAttributes(attributes: SpanAttributes): this; /** Records a span event with optional attributes. */ addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this; /** No-op link addition. */ addLink(_link: Link): this; /** No-op batch link addition. */ addLinks(_links: Link[]): this; /** Records a status change. */ setStatus(status: SpanStatus): this; /** Records a name update. */ updateName(name: string): this; /** Records span end. */ end(endTime?: TimeInput): void; /** Always returns true for mock spans. */ isRecording(): boolean; /** Records an exception. */ recordException(exception: Exception, time?: TimeInput): void; /** * Get the value of a specific attribute set via setAttribute. */ getAttributeValue(key: string): SpanAttributeValue | undefined; /** * Get all events with a given name. */ getEvents(name: string): Array<{ name: string; attributes: SpanAttributes | TimeInput | undefined; }>; } /** * Extract a string attribute from a mock span event's attributes. */ export declare function eventAttr(event: { attributes: SpanAttributes | TimeInput | undefined; }, key: string): string; //# sourceMappingURL=mock-span.d.ts.map