import type { TransportRecord, TransportOptions, IBufferedTransport, HookLogEntry } from '../types/index.js'; /** * Configuration for {@link HttpTransport}. Extends {@link TransportOptions} * with HTTP-specific knobs. * */ export interface HttpTransportOptions extends TransportOptions { /** Target URL. POST is used with a JSON-encoded body. */ url?: string; /** Extra request headers (e.g. `Authorization: Bearer ...`). */ headers?: Record; /** Hard cap on buffered records. Older entries dropped on overflow. */ maxBufferSize?: number; /** Max consecutive retry attempts per batch before the entries are dropped. */ maxRetries?: number; /** Initial backoff in ms. Doubles per attempt up to `maxBackoffMs`. */ initialBackoffMs?: number; /** Backoff ceiling in ms. */ maxBackoffMs?: number; /** Fetch timeout in ms (per attempt). Default 10_000. */ fetchTimeoutMs?: number; /** * Optional hook fired when the buffer overflows or a batch is dropped * after `maxRetries`. The hook receives a synthetic {@link HookLogEntry}. */ onError?: (entry: HookLogEntry) => void | Promise; } /** * HTTP-based transport. Buffers records, batches them on size or interval, * POSTs the batch as JSON, and surfaces failures via retry, bounded buffer, * and an `onError` hook — never a silent `.catch(() => {})`. * * Extending this class is the recommended way to ship a new transport: * see {@link OtlpTransport}. * */ export declare class HttpTransport implements IBufferedTransport { readonly name: string; private buffer; private flushTimer?; private closed; /** Options bag — `protected` so subclasses (e.g. {@link OtlpTransport}) can read or extend it. */ protected options: HttpTransportOptions; constructor(options?: HttpTransportOptions); get bufferSize(): number; get maxBufferSize(): number; isReady(): boolean; write(record: TransportRecord): void; /** * Serialises a batch into the request body. Subclasses override to * switch encodings (e.g. {@link OtlpTransport} produces OTLP/HTTP JSON * instead of the default `{ logs: [...] }` envelope). * */ protected serializeBody(records: TransportRecord[]): string; /** * Builds the request headers. Subclasses may prepend transport-specific * headers (e.g. `signoz-ingestion-key`). * */ protected buildHeaders(): Record; private applyOverflowPolicy; flush(): Promise; private sendWithRetry; close(): Promise; } //# sourceMappingURL=HttpTransport.d.ts.map