/// /// import type * as http from 'http'; import type * as https from 'https'; import type { OTLPExporterConfigBase } from './legacy-base-configuration'; import type { HttpAgentFactory } from './otlp-node-http-configuration'; /** * Node.js HTTP exporter configuration. */ export interface OTLPExporterNodeConfigBase extends OTLPExporterConfigBase { /** * Sets `keepAlive` on the Node.js HTTP or HTTPS agent created by the exporter. * * @remarks * If `httpAgentOptions` is an object with its own `keepAlive` value, the * value in `httpAgentOptions` takes precedence. * * @defaultValue true */ keepAlive?: boolean; /** * Compression algorithm for outgoing OTLP HTTP requests. * * @defaultValue CompressionAlgorithm.NONE */ compression?: CompressionAlgorithm; /** * Custom HTTP agent options or a factory function for creating agents. * * @remarks * Prefer using `http.AgentOptions` or `https.AgentOptions` over a factory function wherever possible. * If using a factory function (`HttpAgentFactory`), **do not import `http.Agent` or `https.Agent` * statically at the top of the file**. * Instead, use dynamic `import()` or `require()` to load the module. This lets * `@opentelemetry/instrumentation-http` instrument the module first. * * @example Using agent options directly: * httpAgentOptions: { * keepAlive: true, * maxSockets: 10 * } * * @example Using a factory with dynamic import: * httpAgentOptions: async (protocol) => { * const module = protocol === 'http:' ? await import('http') : await import('https'); * return new module.Agent({ keepAlive: true }); * } */ httpAgentOptions?: http.AgentOptions | https.AgentOptions | HttpAgentFactory; /** * User agent header string to be prepended to the exporter's default value. * Available since v1.49.0 of the spec. * Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#user-agent */ userAgent?: string; } export declare enum CompressionAlgorithm { NONE = "none", GZIP = "gzip" } //# sourceMappingURL=legacy-node-configuration.d.ts.map