/// import { BasePlugin } from '@opentelemetry/core'; import type { ClientRequest, RequestOptions } from 'http'; import * as url from 'url'; import { Func, Http, HttpPluginConfig, HttpRequestArgs } from './types'; /** * Http instrumentation plugin for Opentelemetry */ export declare class HttpPlugin extends BasePlugin { readonly moduleName: string; readonly version: string; readonly component: string; protected _config: HttpPluginConfig; /** keep track on spans not ended */ private readonly _spanNotEnded; constructor(moduleName: string, version: string); /** Patches HTTP incoming and outcoming request functions. */ protected patch(): typeof import("http"); /** Unpatches all HTTP patched function. */ protected unpatch(): void; /** * Creates spans for incoming requests, restoring spans' context if applied. */ protected _getPatchIncomingRequestFunction(): (original: (event: string, ...args: unknown[]) => boolean) => (this: {}, event: string, ...args: unknown[]) => boolean; /** * Creates spans for outgoing requests, sending spans' context for distributed * tracing. */ protected _getPatchOutgoingRequestFunction(): (original: Func) => Func; protected _getPatchOutgoingGetFunction(clientRequest: (options: RequestOptions | string | url.URL, ...args: HttpRequestArgs) => ClientRequest): (_original: Func) => Func; /** * Attach event listeners to a client request to end span and add span attributes. * * @param request The original request object. * @param options The arguments to the original function. * @param span representing the current operation */ private _traceClientRequest; private _incomingRequestFunction; private _outgoingRequestFunction; private _startHttpSpan; private _closeHttpSpan; private _callResponseHook; private _callRequestHook; private _safeExecute; } export declare const plugin: HttpPlugin;