import { Middleware, MiddlewareContext, MiddlewareName, MiddlewareNext } from './types'; import { TransportResult } from '../types'; /** Endpoints whose body can be captured as `db.query.text`. */ export declare const SEARCH_LIKE_ENDPOINTS: ReadonlySet; /** Endpoints whose body is an ES|QL/SQL string query (captured only when parameterized). */ export declare const STRING_QUERY_ENDPOINTS: ReadonlySet; /** Endpoints whose body is NDJSON (header + query line pairs). */ export declare const NDJSON_ENDPOINTS: ReadonlySet; /** Max length of the `db.query.text` attribute, in characters. */ export declare const SEARCH_QUERY_MAX_LENGTH = 2048; export interface OpenTelemetryOptions { enabled?: boolean; /** * Suppresses tracing for the request: the Elasticsearch span is non-recording * and, because the suppressed context is active during the HTTP call, lower-level * HTTP (e.g. undici) instrumentation is suppressed too. */ suppressInternalInstrumentation?: boolean; /** * Records sanitized request bodies as `db.query.text`. Off by default: even * sanitized, query structure can reveal schema or search patterns, so enable only * where tracing data is access-controlled. */ captureSearchQuery?: boolean; } export declare class OpenTelemetryMiddleware implements Middleware { readonly name = MiddlewareName.OPEN_TELEMETRY; readonly priority: number; private readonly tracer; private readonly transportOptions; private readonly serializer; constructor(transportOptions: OpenTelemetryOptions); around: (ctx: MiddlewareContext, next: MiddlewareNext) => Promise; private setResponseAttributes; private buildAttributes; private captureQueryText; }